Eric Pouech : conhost: Handle csi escape sequence for shift tab.

Alexandre Julliard julliard at winehq.org
Mon Feb 28 15:50:30 CST 2022


Module: wine
Branch: master
Commit: 5b3bc2eeb44185ab36db56a8f53b025c1b85dca8
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=5b3bc2eeb44185ab36db56a8f53b025c1b85dca8

Author: Eric Pouech <eric.pouech at gmail.com>
Date:   Wed Feb 23 18:05:34 2022 +0100

conhost: Handle csi escape sequence for shift tab.

Signed-off-by: Eric Pouech <eric.pouech at gmail.com>
Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 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 8b03d749d21..ae1f4e35f41 100644
--- a/programs/conhost/conhost.c
+++ b/programs/conhost/conhost.c
@@ -1507,8 +1507,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;
@@ -1521,6 +1524,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 = '\t'; return VK_TAB;}
+        return 0;
     default:  return 0;
     }
 }
@@ -1558,7 +1563,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 (;;)
     {
@@ -1572,9 +1578,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;
     }
 
@@ -1610,7 +1616,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 );




More information about the wine-cvs mailing list