mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-12-27 07:10:32 +01:00
win32: set IgnoreNextCharWindow on WM_KEYDOWN, WM_SYSKEYDOWN and clear it if it is not processed (fixes issue #0020993)
git-svn-id: trunk@35965 -
This commit is contained in:
parent
dd1c5a1062
commit
694635da21
@ -1060,19 +1060,13 @@ begin
|
||||
end else begin
|
||||
lWinControl := WindowInfo^.WinControl;
|
||||
end;
|
||||
{$ifdef MSG_DEBUG}
|
||||
DebugLn(MessageStackDepth, 'lWinControl: ',DbgSName(lWinControl));
|
||||
{$endif}
|
||||
if (IgnoreNextCharWindow <> 0) and ((Msg = WM_CHAR) or (Msg = WM_SYSCHAR)) then
|
||||
begin
|
||||
if IgnoreNextCharWindow = Window then
|
||||
begin
|
||||
IgnoreNextCharWindow := 0;
|
||||
{$ifdef MSG_DEBUG}
|
||||
DebugLn(MessageStackDepth, ' *ignoring this character');
|
||||
{$endif}
|
||||
Result := 1;
|
||||
exit;
|
||||
Exit;
|
||||
end;
|
||||
IgnoreNextCharWindow := 0;
|
||||
end;
|
||||
@ -1577,6 +1571,7 @@ begin
|
||||
end;
|
||||
WindowInfo^.IMEComposed:=False;
|
||||
WinProcess := false;
|
||||
IgnoreNextCharWindow := Window;
|
||||
end;
|
||||
WM_KEYUP:
|
||||
begin
|
||||
@ -2087,6 +2082,7 @@ begin
|
||||
Result := 0;
|
||||
end;
|
||||
WinProcess := false;
|
||||
IgnoreNextCharWindow := Window;
|
||||
end;
|
||||
WM_SYSKEYUP:
|
||||
begin
|
||||
@ -2564,21 +2560,8 @@ begin
|
||||
// ignore WM_(SYS)CHAR message if LCL handled WM_(SYS)KEYDOWN
|
||||
if ((Msg = WM_KEYDOWN) or (Msg = WM_SYSKEYDOWN)) then
|
||||
begin
|
||||
if (PLMsg^.Result <> 0) then
|
||||
begin
|
||||
{$ifdef MSG_DEBUG}
|
||||
debugln(MessageStackDepth, ' *ignore next character');
|
||||
{$endif}
|
||||
IgnoreNextCharWindow := Window;
|
||||
end else begin
|
||||
// stop ignoring if KEYUP has come by (not all keys generate CHAR)
|
||||
// assume WM_CHAR is always preceded by WM_KEYDOWN
|
||||
{$ifdef MSG_DEBUG}
|
||||
if IgnoreNextCharWindow <> 0 then
|
||||
debugln(MessageStackDepth, ' *stop ignoring next character');
|
||||
{$endif}
|
||||
if (PLMsg^.Result = 0) then
|
||||
IgnoreNextCharWindow := 0;
|
||||
end;
|
||||
end;
|
||||
|
||||
{ LMInsertText has no Result field }
|
||||
|
||||
Loading…
Reference in New Issue
Block a user