Fix non-US keyboard related issue and scp x86 debug build error
This commit is contained in:
bagajjal 2017-12-05 12:58:47 -08:00 committed by GitHub
commit ef55537c8b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -131,6 +131,7 @@ ReadConsoleForTermEmul(HANDLE hInput, char *destin, int destinlen)
DWORD nHandle = 1;
DWORD dwInput = 0;
DWORD dwControlKeyState = 0;
DWORD dwAltGrFlags = LEFT_CTRL_PRESSED | RIGHT_ALT_PRESSED;
DWORD rc = 0;
unsigned char octets[20];
char aChar = 0;
@ -161,6 +162,11 @@ ReadConsoleForTermEmul(HANDLE hInput, char *destin, int destinlen)
bShift = (InputRecord.Event.KeyEvent.dwControlKeyState & SHIFT_PRESSED);
dwControlKeyState = InputRecord.Event.KeyEvent.dwControlKeyState &
~(CAPSLOCK_ON | ENHANCED_KEY | NUMLOCK_ON | SCROLLLOCK_ON);
/* ignore the AltGr flags*/
if ((dwControlKeyState & dwAltGrFlags) == dwAltGrFlags)
dwControlKeyState = dwControlKeyState & ~dwAltGrFlags;
modKey = GetModifierKey(dwControlKeyState);
if (InputRecord.Event.KeyEvent.bKeyDown) {
int n = WideCharToMultiByte(