X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Usermode%2FApplications%2Fgui_shell_src%2Fmain.c;h=4b82d0e08bcb34a5e3dfa6e0f82e53e4a20011bf;hb=b0da731b2d89b9dd58de2c98eaf6218a41a21920;hp=1c748b32ef9e462a6349af402c6664b63ef2a07d;hpb=8ca18a718af411a8391be8629e1201983044a88f;p=tpg%2Facess2.git diff --git a/Usermode/Applications/gui_shell_src/main.c b/Usermode/Applications/gui_shell_src/main.c index 1c748b32..4b82d0e0 100644 --- a/Usermode/Applications/gui_shell_src/main.c +++ b/Usermode/Applications/gui_shell_src/main.c @@ -116,10 +116,10 @@ int Term_KeyHandler(tHWND Window, int bPress, uint32_t KeySym, uint32_t Translat switch(KeySym) { case KEYSYM_LEFTCTRL: - _bitset(ctrl_state, 0, bPress); + _bitset(ctrl_state, 0, bPress!=0); return 0; case KEYSYM_RIGHTCTRL: - _bitset(ctrl_state, 0, bPress); + _bitset(ctrl_state, 1, bPress!=0); return 0; } #undef _bitset @@ -131,30 +131,35 @@ int Term_KeyHandler(tHWND Window, int bPress, uint32_t KeySym, uint32_t Translat Translated = KeySym - KEYSYM_a + 1; } - if( Translated ) + // == 2 :: FIRE + if( bPress == 2 ) { - char buf[6]; - int len; - - // Encode and send - len = WriteUTF8(buf, Translated); - - _SysWrite(giChildStdin, buf, len); + if( Translated ) + { + char buf[6]; + int len; + + // Encode and send + len = WriteUTF8(buf, Translated); + + _SysDebug("Keystroke translated to '%.*s'", len, buf); + _SysWrite(giChildStdin, buf, len); + + return 0; + } - return 0; - } - - // No translation, look for escape sequences to send - const char *str = NULL; - switch(KeySym) - { - case KEYSYM_LEFTARROW: - str = "\x1b[D"; - break; - } - if( str ) - { - _SysWrite(giChildStdin, str, strlen(str)); + // No translation, look for escape sequences to send + const char *str = NULL; + switch(KeySym) + { + case KEYSYM_LEFTARROW: + str = "\x1b[D"; + break; + } + if( str ) + { + _SysWrite(giChildStdin, str, strlen(str)); + } } return 0; }