Skip to content
Snippets Groups Projects
Commit b598e9b2 authored by deuce's avatar deuce
Browse files

Fix up CTRL key handling.

parent 81f08f66
Branches
Tags
No related merge requests found
......@@ -15,6 +15,7 @@ void input_thread(void *args)
int key;
INPUT_RECORD ckey;
int alt=0;
int ctrl=0;
DWORD d;
SHORT s;
......@@ -46,6 +47,30 @@ void input_thread(void *args)
if(alt)
continue;
}
if(key < ' ') {
/* If this is NOT a "normal" key, fiddle with CTRL */
switch(key) {
case 8:
case 9:
case 10:
case 13:
case 27:
break;
default:
ctrl=1;
ckey.Event.KeyEvent.bKeyDown=TRUE;
ckey.Event.KeyEvent.dwControlKeyState = LEFT_CTRL_PRESSED;
ckey.Event.KeyEvent.wRepeatCount=1;
ckey.Event.KeyEvent.wVirtualKeyCode=VK_CONTROL;
ckey.Event.KeyEvent.wVirtualScanCode=MapVirtualKey(ckey.Event.KeyEvent.wVirtualKeyCode, 0);
ckey.Event.KeyEvent.uChar.AsciiChar=0;
d=0;
while(!d) {
if(!WriteConsoleInput(console_input, &ckey, 1, &d))
d=0;
}
}
}
ckey.Event.KeyEvent.bKeyDown=TRUE;
ckey.Event.KeyEvent.wRepeatCount=1;
......@@ -175,6 +200,20 @@ void input_thread(void *args)
}
alt=0;
}
if(ctrl) {
ckey.Event.KeyEvent.bKeyDown=FALSE;
ckey.Event.KeyEvent.wRepeatCount=1;
ckey.Event.KeyEvent.wVirtualKeyCode=VK_CONTROL;
ckey.Event.KeyEvent.wVirtualScanCode=MapVirtualKey(ckey.Event.KeyEvent.wVirtualKeyCode, 0);
ckey.Event.KeyEvent.uChar.AsciiChar=0;
ckey.Event.KeyEvent.dwControlKeyState = LEFT_CTRL_PRESSED;
d=0;
while(!d) {
if(!WriteConsoleInput(console_input, &ckey, 1, &d))
d=0;
}
alt=0;
}
}
input_thread_running=0;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment