From c31c0e00a480c1b6c016fc8eba14d41c8750e1d3 Mon Sep 17 00:00:00 2001 From: micha Date: Sat, 10 Dec 2005 18:56:48 +0000 Subject: [PATCH] also check whether ignore char for same window git-svn-id: trunk@8289 - --- lcl/interfaces/win32/win32callback.inc | 30 ++++++++++++++++++++------ lcl/interfaces/win32/win32int.pp | 2 +- 2 files changed, 25 insertions(+), 7 deletions(-) diff --git a/lcl/interfaces/win32/win32callback.inc b/lcl/interfaces/win32/win32callback.inc index 6eb2f97b2c..3bf51407c1 100644 --- a/lcl/interfaces/win32/win32callback.inc +++ b/lcl/interfaces/win32/win32callback.inc @@ -773,11 +773,18 @@ Begin lWinControl := WindowInfo^.WinControl; end; - if IgnoreNextChar and ((Msg = WM_CHAR) or (Msg = WM_SYSCHAR)) then + if (IgnoreNextCharWindow <> 0) and ((Msg = WM_CHAR) or (Msg = WM_SYSCHAR)) then begin - IgnoreNextChar := false; - Result := 1; - exit; + if IgnoreNextCharWindow = Window then + begin + IgnoreNextCharWindow := 0; +{$ifdef MSG_DEBUG} + DebugLn(MessageStackDepth, ' *ignoring this character'); +{$endif} + Result := 1; + exit; + end; + IgnoreNextCharWindow := 0; end; Assert(False, 'Trace:WindowProc - Getting Callback Object'); @@ -1804,10 +1811,21 @@ Begin // ignore WM_(SYS)CHAR message if LCL handled WM_(SYS)KEYDOWN if ((Msg = WM_KEYDOWN) or (Msg = WM_SYSKEYDOWN)) and (PLMsg^.Result <> 0) then - IgnoreNextChar := true; + begin +{$ifdef MSG_DEBUG} + writeln(MessageStackDepth, ' *ignore next character'); +{$endif} + IgnoreNextCharWindow := Window; + end; // stop ignoring if KEYUP has come by (not all keys generate CHAR) if ((Msg = WM_KEYUP) or (Msg = WM_SYSKEYUP)) then - IgnoreNextChar := false; + begin +{$ifdef MSG_DEBUG} + if IgnoreNextCharWindow <> 0 then + writeln(MessageStackDepth, ' *stop ignoring next character'); +{$endif} + IgnoreNextCharWindow := 0; + end; end; { LMMouseEvent and LMInsertText have no Result field } diff --git a/lcl/interfaces/win32/win32int.pp b/lcl/interfaces/win32/win32int.pp index c1620bb3ff..a9e627e5a0 100644 --- a/lcl/interfaces/win32/win32int.pp +++ b/lcl/interfaces/win32/win32int.pp @@ -273,7 +273,7 @@ var MouseDownFocusWindow: HWND; MouseDownFocusStatus: TMouseDownFocusStatus = mfNone; ComboBoxHandleSizeWindow: HWND = 0; - IgnoreNextChar: boolean = false; // ignore next WM_(SYS)CHAR message + IgnoreNextCharWindow: HWND = 0; // ignore next WM_(SYS)CHAR message OnClipBoardRequest: TClipboardRequestEvent; {$ifdef MSG_DEBUG} MessageStackDepth: string = '';