vte: implement editing keys

Implement the basic editing keys that are used by several applications. We
use the 7bit CSI sequence to avoid UTF8 issues. Otherwise, we would have
to encode the C1 CSI 0x9b as UTF8 character which is also a 2 byte
sequence.

Besides INSERT, DELETE, PAGEUP and PAGEDOWN an VT220 also had SELECT and
FIND keys which we do not implement as they are not present on modern
keyboards.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This commit is contained in:
David Herrmann 2012-05-28 14:01:22 +02:00
parent 2396423d03
commit 8157556602

View File

@ -1098,6 +1098,22 @@ int kmscon_vte_handle_keyboard(struct kmscon_vte *vte,
*u8 = "\x0d";
*len = 1;
return KMSCON_VTE_SEND;
case XK_Insert:
*u8 = "\e[2~";
*len = 4;
return KMSCON_VTE_SEND;
case XK_Delete:
*u8 = "\e[3~";
*len = 4;
return KMSCON_VTE_SEND;
case XK_Page_Up:
*u8 = "\e[5~";
*len = 4;
return KMSCON_VTE_SEND;
case XK_Page_Down:
*u8 = "\e[6~";
*len = 4;
return KMSCON_VTE_SEND;
}
if (ev->unicode != UTERM_INPUT_INVALID) {