From ccf29a98d96e1c1b8612b15e078ccddb6b1d2125 Mon Sep 17 00:00:00 2001 From: "K. Lange" Date: Wed, 1 Aug 2018 09:44:26 +0900 Subject: [PATCH] Handle ^[[1,5D from vte, though not well --- lib/kbd.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/lib/kbd.c b/lib/kbd.c index a0acfee0..de0d355c 100644 --- a/lib/kbd.c +++ b/lib/kbd.c @@ -1,8 +1,8 @@ -/* This file is part of ToaruOS and is released under the terms +/* vim: ts=4 sw=4 noexpandtab + * This file is part of ToaruOS and is released under the terms * of the NCSA / University of Illinois License - see LICENSE.md * Copyright (C) 2012-2018 K. Lange - */ -/* + * * General-purpose keyboard conversion library. * * This provides similar functionality to xkb: @@ -175,6 +175,7 @@ kbd_key_t kbd_key(key_event_state_t * state, unsigned char c) { case 0x44: state->kbd_state = KBD_NORMAL; return KEY_ARROW_LEFT; + case '1': case '2': case '3': case '4': @@ -254,6 +255,12 @@ kbd_key_t kbd_key(key_event_state_t * state, unsigned char c) { default: return c; } + case ';': + /* We don't produce multiple-argument escapes ourself, but + * we should handle them anyway because other terminals + * definitely do make them... */ + state->kbd_state = KBD_ESC_B; + return KEY_NONE; default: return c; }