Qt: use native VK code provided by qt in TLMKey under windows instead of qt key code -> VK mapping

git-svn-id: trunk@12079 -
This commit is contained in:
paul 2007-09-19 15:46:16 +00:00
parent 615e7fb75a
commit f40ff94387

View File

@ -1458,19 +1458,18 @@ begin
IsSysKey := (QtAltModifier and Modifiers) <> $0; IsSysKey := (QtAltModifier and Modifiers) <> $0;
KeyMsg.KeyData := QtKeyModifiersToKeyState(Modifiers); KeyMsg.KeyData := QtKeyModifiersToKeyState(Modifiers);
{ {$ifdef windows}
on windows we can use:
KeyMsg.CharCode := QKeyEvent_nativeVirtualKey(QKeyEventH(Event)); KeyMsg.CharCode := QKeyEvent_nativeVirtualKey(QKeyEventH(Event));
// todo: VK to Win_VK for other os too
} {$endif}
// Loads the UTF-8 character associated with the keypress, if any // Loads the UTF-8 character associated with the keypress, if any
QKeyEvent_text(QKeyEventH(Event), @Text); QKeyEvent_text(QKeyEventH(Event), @Text);
// Translates a Qt4 Key to a LCL VK_* key // Translates a Qt4 Key to a LCL VK_* key
KeyMsg.CharCode := QtKeyToLCLKey(QKeyEvent_key(QKeyEventH(Event)), Text); if KeyMsg.CharCode = 0 then
KeyMsg.CharCode := QtKeyToLCLKey(QKeyEvent_key(QKeyEventH(Event)), Text);
{------------------------------------------------------------------------------ {------------------------------------------------------------------------------
Sends the adequate key messages Sends the adequate key messages
------------------------------------------------------------------------------} ------------------------------------------------------------------------------}