Signed-off-by: Eric Pouech eric.pouech@gmail.com
--- programs/conhost/conhost.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-)
diff --git a/programs/conhost/conhost.c b/programs/conhost/conhost.c index 70ff054372e..aa869587159 100644 --- a/programs/conhost/conhost.c +++ b/programs/conhost/conhost.c @@ -1555,8 +1555,11 @@ static void char_key_press( struct console *console, WCHAR ch, unsigned int ctrl key_press( console, ch, vk, ctrl ); }
-static unsigned int escape_char_to_vk( WCHAR ch ) +static unsigned int escape_char_to_vk( WCHAR ch, unsigned int *ctrl, WCHAR *outuch ) { + if (ctrl) *ctrl = 0; + if (outuch) *outuch = '\0'; + switch (ch) { case 'A': return VK_UP; @@ -1569,6 +1572,8 @@ static unsigned int escape_char_to_vk( WCHAR ch ) case 'Q': return VK_F2; case 'R': return VK_F3; case 'S': return VK_F4; + case 'Z': if (ctrl && outuch) {*ctrl = SHIFT_PRESSED; *outuch = L'\t'; return VK_TAB;} + return 0; default: return 0; } } @@ -1606,7 +1611,8 @@ static unsigned int convert_modifiers( unsigned int n )
static unsigned int process_csi_sequence( struct console *console, const WCHAR *buf, size_t size ) { - unsigned int n, count = 0, params[8], params_cnt = 0, vk; + unsigned int n, count = 0, params[8], params_cnt = 0, vk, ctrl; + WCHAR outuch;
for (;;) { @@ -1620,9 +1626,9 @@ static unsigned int process_csi_sequence( struct console *console, const WCHAR * if (++count == size) return 0; }
- if ((vk = escape_char_to_vk( buf[count] ))) + if ((vk = escape_char_to_vk( buf[count], &ctrl, &outuch ))) { - key_press( console, 0, vk, params_cnt >= 2 ? convert_modifiers( params[1] ) : 0 ); + key_press( console, outuch, vk, params_cnt >= 2 ? convert_modifiers( params[1] ) : ctrl ); return count + 1; }
@@ -1658,7 +1664,7 @@ static unsigned int process_input_escape( struct console *console, const WCHAR *
case 'O': if (++count == size) break; - vk = escape_char_to_vk( buf[1] ); + vk = escape_char_to_vk( buf[1], NULL, NULL ); if (vk) { key_press( console, 0, vk, 0 );