send arrow keys correctly via vterm

This commit is contained in:
cy384 2020-08-31 19:36:19 -04:00
parent 352f06ae40
commit 241c76e164
1 changed files with 20 additions and 3 deletions

View File

@ -317,9 +317,26 @@ void event_loop(void)
}
else if (c)
{
if ('\r' == c) c = '\n';
ssh_con.send_buffer[0] = c;
ssh_write(ssh_con.send_buffer, 1);
switch(c)
{
case kLeftArrowCharCode:
vterm_keyboard_key(con.vterm, VTERM_KEY_LEFT, VTERM_MOD_NONE);
break;
case kRightArrowCharCode:
vterm_keyboard_key(con.vterm, VTERM_KEY_RIGHT, VTERM_MOD_NONE);
break;
case kUpArrowCharCode:
vterm_keyboard_key(con.vterm, VTERM_KEY_UP, VTERM_MOD_NONE);
break;
case kDownArrowCharCode:
vterm_keyboard_key(con.vterm, VTERM_KEY_DOWN, VTERM_MOD_NONE);
break;
default:
if ('\r' == c) c = '\n';
ssh_con.send_buffer[0] = c;
ssh_write(ssh_con.send_buffer, 1);
break;
}
}
case mouseDown: