From 05860b2a319b20e9abd9050b04f2c6a1fc9982ef Mon Sep 17 00:00:00 2001 From: "Alexander S.Kresin" Date: Mon, 14 Aug 2000 06:59:50 +0000 Subject: [PATCH] 2000-08-14 11:00 GMT+3 Alexander Kresin --- harbour/ChangeLog | 6 ++++++ harbour/source/rtl/gtwin/gtwin.c | 11 +++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index a6a58e6dc1..d4a513289a 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,3 +1,9 @@ +2000-08-14 11:00 GMT+3 Alexander Kresin + * source/rtl/gtwin/gtwin.c + * fixed handling of arrow keys for international keyboards + * this need to be checked for different keyboards ( now it works + * for my :) ) + Changelog: 2000-08-13 15:20 UTC+0500 April White * doc/en/ - removed hbapi.txt hbcompat.txt hbset.txt diff --git a/harbour/source/rtl/gtwin/gtwin.c b/harbour/source/rtl/gtwin/gtwin.c index 18a0ba916c..37f5612ab4 100644 --- a/harbour/source/rtl/gtwin/gtwin.c +++ b/harbour/source/rtl/gtwin/gtwin.c @@ -314,22 +314,25 @@ int hb_gt_ReadKey( HB_inkey_enum eventmask ) { /* Save the keyboard state and ASCII key code */ DWORD dwState = s_irInBuf[ s_cNumIndex ].Event.KeyEvent.dwControlKeyState; + WORD wChar = s_irInBuf[ s_cNumIndex ].Event.KeyEvent.wVirtualKeyCode; + WORD wKey = s_irInBuf[ s_cNumIndex ].Event.KeyEvent.wVirtualScanCode; ch = s_irInBuf[ s_cNumIndex ].Event.KeyEvent.uChar.AsciiChar; if( ch == 224 ) { /* Strip extended key lead-in codes */ ch = 0; } - else if( ch < 0 ) + /* && ( ch != -32 || wChar > 50 ) added for + international keyboard support ( Alexander Kresin ) */ + else if( ch < 0 && ( ch != -32 || wChar > 50 ) ) { /* Process international key codes */ ch += 256; } - else if( ch == 0 || ( dwState & ( ENHANCED_KEY | LEFT_ALT_PRESSED | LEFT_CTRL_PRESSED | RIGHT_ALT_PRESSED | RIGHT_CTRL_PRESSED | SHIFT_PRESSED ) ) ) + /* && ch == -32 added for international keyboard support ( Alexander Kresin ) */ + else if( ch == 0 || ch == -32 || ( dwState & ( ENHANCED_KEY | LEFT_ALT_PRESSED | LEFT_CTRL_PRESSED | RIGHT_ALT_PRESSED | RIGHT_CTRL_PRESSED | SHIFT_PRESSED ) ) ) { /* Process non-ASCII key codes */ - WORD wChar = s_irInBuf[ s_cNumIndex ].Event.KeyEvent.wVirtualKeyCode; - WORD wKey = s_irInBuf[ s_cNumIndex ].Event.KeyEvent.wVirtualScanCode; if( eventmask & INKEY_RAW ) wKey = wChar; /* Discard standalone state key presses for normal mode only */ if( ( eventmask & INKEY_RAW ) == 0 ) switch( wKey )