From f40ff94387e18fbfd47b61b6457a6610c1f93e06 Mon Sep 17 00:00:00 2001 From: paul Date: Wed, 19 Sep 2007 15:46:16 +0000 Subject: [PATCH] Qt: use native VK code provided by qt in TLMKey under windows instead of qt key code -> VK mapping git-svn-id: trunk@12079 - --- lcl/interfaces/qt/qtwidgets.pas | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/lcl/interfaces/qt/qtwidgets.pas b/lcl/interfaces/qt/qtwidgets.pas index 11db773867..c9f8ee68be 100644 --- a/lcl/interfaces/qt/qtwidgets.pas +++ b/lcl/interfaces/qt/qtwidgets.pas @@ -1458,19 +1458,18 @@ begin IsSysKey := (QtAltModifier and Modifiers) <> $0; KeyMsg.KeyData := QtKeyModifiersToKeyState(Modifiers); - { - on windows we can use: - + {$ifdef windows} 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 QKeyEvent_text(QKeyEventH(Event), @Text); // 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 ------------------------------------------------------------------------------}