From 95e234bd6e26cd9c0ae76ceff332d87f6f97211f Mon Sep 17 00:00:00 2001 From: vincents Date: Mon, 7 Apr 2008 08:46:39 +0000 Subject: [PATCH] win32 interface: improved wm_char handling git-svn-id: trunk@14770 - --- lcl/interfaces/win32/win32callback.inc | 19 ++++++++++++++++++- lcl/interfaces/win32/win32lclintf.inc | 6 +++++- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/lcl/interfaces/win32/win32callback.inc b/lcl/interfaces/win32/win32callback.inc index 23603046e0..39a3ac00d1 100644 --- a/lcl/interfaces/win32/win32callback.inc +++ b/lcl/interfaces/win32/win32callback.inc @@ -1216,6 +1216,7 @@ begin end; WM_CHAR: begin + {$ifdef WindowsUnicodeSupport} // first send a IntfUTF8KeyPress to the LCL // if the key was not handled send a CN_CHAR for AnsiChar<=#127 if not HandleUnicodeChar(Word(WParam)) and (WParam<=127) then @@ -1229,9 +1230,25 @@ begin Result := 0; Assert(False,Format('WM_CHAR KeyData= %d CharCode= %d ',[KeyData,CharCode])); end; - end; + WinProcess := false; + end + else + WinProcess := true; + {$else} + // first send a IntfUTF8KeyPress to the LCL + // if the key was not handled send a CN_CHAR for AnsiChar<=#127 + PLMsg:=@LMChar; + with LMChar do + begin + Msg := CN_CHAR; + KeyData := LParam; + CharCode := Word(WParam); + Result := 0; + Assert(False,Format('WM_CHAR KeyData= %d CharCode= %d ',[KeyData,CharCode])); + end; WinProcess := false; + {$endif} end; WM_MENUCHAR: diff --git a/lcl/interfaces/win32/win32lclintf.inc b/lcl/interfaces/win32/win32lclintf.inc index 8eadf83086..707fa9543d 100644 --- a/lcl/interfaces/win32/win32lclintf.inc +++ b/lcl/interfaces/win32/win32lclintf.inc @@ -386,7 +386,11 @@ end; ------------------------------------------------------------------------------} function TWin32WidgetSet.IntfSendsUTF8KeyPress: boolean; begin - Result := UnicodeEnabledOS; + {$ifdef WindowsUnicodeSupport} + Result := true; + {$else} + Result := false; + {$endif} end; function TWin32WidgetSet.LoadStockPixmap(StockID: longint; var Mask: HBitmap): HBitmap;