From 0f93e2212064e9ab497d0b492dd7aeec04fb50b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Przemys=C5=82aw=20Czerpak?= Date: Wed, 4 May 2016 13:29:21 +0200 Subject: [PATCH] 2016-05-04 13:29 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl) * src/rtl/gtwin/gtwin.c ! strip ALT+CTRL and ALTGR from extended keycode when these modifiers are used with ASCII characters - it should fix problem with some national keyboards --- ChangeLog.txt | 6 ++++++ src/rtl/gtwin/gtwin.c | 12 +++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index f727c7fc9b..98775bb453 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -10,6 +10,12 @@ * Change, ! Fix, % Optimization, + Addition, - Removal, ; Comment */ +2016-05-04 13:29 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl) + * src/rtl/gtwin/gtwin.c + ! strip ALT+CTRL and ALTGR from extended keycode when these modifiers + are used with ASCII characters - it should fix problem with some + national keyboards + 2016-04-29 16:25 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl) * src/rtl/filesys.c * src/rtl/hbcom.c diff --git a/src/rtl/gtwin/gtwin.c b/src/rtl/gtwin/gtwin.c index 187c5fd509..a78edafa7f 100644 --- a/src/rtl/gtwin/gtwin.c +++ b/src/rtl/gtwin/gtwin.c @@ -1574,7 +1574,17 @@ static int hb_gt_win_ReadKey( PHB_GT pGT, int iEventMask ) iKey = HB_INKEY_NEW_UNICODEF( u, iFlags ); #endif else if( iChar < 127 && ( iFlags & ( HB_KF_CTRL | HB_KF_ALT ) ) ) - iKey = HB_INKEY_NEW_KEY( iChar, iFlags ); + { + if( iChar >= 32 && + ( ( ( iFlags & HB_KF_CTRL ) != 0 && ( iFlags & HB_KF_ALT ) != 0 ) || + ( dwState & ( LEFT_ALT_PRESSED | RIGHT_ALT_PRESSED ) ) == RIGHT_ALT_PRESSED ) ) + { + iFlags &= ~( HB_KF_CTRL | HB_KF_ALT ); + iKey = HB_INKEY_NEW_CHARF( iChar, iFlags ); + } + else + iKey = HB_INKEY_NEW_KEY( iChar, iFlags ); + } else iKey = HB_INKEY_NEW_CHARF( iChar, iFlags ); }