win32 interface: improved wm_char handling

git-svn-id: trunk@14770 -
This commit is contained in:
vincents 2008-04-07 08:46:39 +00:00
parent 7b3bf328ae
commit 95e234bd6e
2 changed files with 23 additions and 2 deletions

View File

@ -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:

View File

@ -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;