From 42d9cb33a555d113897b5decb29c099b4d47a164 Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Tue, 10 Jul 2012 18:14:02 -0700 Subject: [PATCH] Expand keycode to 'int' from 'short' This uses the four high bits for the meta and control key sequences. This means that we will be limiting our Unicode space to 28 bits, but that's more than we really need. It *would* be nicer if we just used the sign bit to mark "we have meta character information") but that would require bigger changes. And we really don't need to worry about 30-bit unicode. Small steps, remember. Signed-off-by: Linus Torvalds --- estruct.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/estruct.h b/estruct.h index 61de40b..1a7a683 100644 --- a/estruct.h +++ b/estruct.h @@ -237,10 +237,10 @@ #define NCOLORS 8 /* number of supported colors */ #define KBLOCK 250 /* sizeof kill buffer chunks */ -#define CONTROL 0x0100 /* Control flag, or'ed in */ -#define META 0x0200 /* Meta flag, or'ed in */ -#define CTLX 0x0400 /* ^X flag, or'ed in */ -#define SPEC 0x0800 /* special key (function keys) */ +#define CONTROL 0x10000000 /* Control flag, or'ed in */ +#define META 0x20000000 /* Meta flag, or'ed in */ +#define CTLX 0x40000000 /* ^X flag, or'ed in */ +#define SPEC 0x80000000 /* special key (function keys) */ #ifdef FALSE #undef FALSE @@ -556,7 +556,7 @@ struct terminal { /* Structure for the table of initial key bindings. */ struct key_tab { - short k_code; /* Key code */ + int k_code; /* Key code */ int (*k_fp)(int, int); /* Routine to handle it */ };