diff --git a/src/settings.c b/src/settings.c index c39e74104..31944b170 100644 --- a/src/settings.c +++ b/src/settings.c @@ -321,10 +321,30 @@ static int key_parse(const char **bind) } } + if (strncasecmp(*bind, "alt", 3) == 0) { + return 0x300+toupper(bind[0][4]) - 'A' + 1; + } + if (strncasecmp(*bind, "tab", 3) == 0) { return T_KEY_TAB; } + if (strncasecmp(*bind, "up", 2) == 0) { + return KEY_UP; + } + + if (strncasecmp(*bind, "down", 4) == 0) { + return KEY_DOWN; + } + + if (strncasecmp(*bind, "right", 5) == 0) { + return KEY_RIGHT; + } + + if (strncasecmp(*bind, "left", 4) == 0) { + return KEY_LEFT; + } + if (strncasecmp(*bind, "page", 4) == 0) { return len == 6 ? KEY_PPAGE : KEY_NPAGE; } diff --git a/src/toxic_constants.h b/src/toxic_constants.h index cf80e55e3..c5dd9e780 100644 --- a/src/toxic_constants.h +++ b/src/toxic_constants.h @@ -70,6 +70,33 @@ #define T_KEY_C_DOWN 0x20D /* ctrl-down arrow */ #define T_KEY_TAB 0x09 /* TAB key */ +#define T_KEY_A_A 0x301 +#define T_KEY_A_B 0x302 +#define T_KEY_A_C 0x303 +#define T_KEY_A_D 0x304 +#define T_KEY_A_E 0x305 +#define T_KEY_A_F 0x306 +#define T_KEY_A_G 0x307 +#define T_KEY_A_H 0x308 +#define T_KEY_A_I 0x309 +#define T_KEY_A_J 0x30a +#define T_KEY_A_K 0x30b +#define T_KEY_A_L 0x30c +#define T_KEY_A_M 0x30d +#define T_KEY_A_N 0x30e +#define T_KEY_A_O 0x30f +#define T_KEY_A_P 0x310 +#define T_KEY_A_Q 0x311 +#define T_KEY_A_R 0x312 +#define T_KEY_A_S 0x313 +#define T_KEY_A_T 0x314 +#define T_KEY_A_U 0x315 +#define T_KEY_A_V 0x316 +#define T_KEY_A_W 0x317 +#define T_KEY_A_X 0x318 +#define T_KEY_A_Y 0x319 +#define T_KEY_A_Z 0x31a + #define ONLINE_CHAR "o" #define OFFLINE_CHAR "o" diff --git a/src/windows.c b/src/windows.c index ca955bcf9..793b5224f 100644 --- a/src/windows.c +++ b/src/windows.c @@ -1196,6 +1196,36 @@ static struct key_sequence_codes { { L"[1;5B", T_KEY_C_DOWN }, { L"[1;5C", T_KEY_C_RIGHT }, { L"[1;5D", T_KEY_C_LEFT }, + { L"[A", KEY_UP }, + { L"[B", KEY_DOWN }, + { L"[C", KEY_RIGHT }, + { L"[D", KEY_LEFT }, + { L"a", T_KEY_A_A }, + { L"b", T_KEY_A_B }, + { L"c", T_KEY_A_C }, + { L"d", T_KEY_A_D }, + { L"e", T_KEY_A_E }, + { L"f", T_KEY_A_F }, + { L"g", T_KEY_A_G }, + { L"h", T_KEY_A_H }, + { L"i", T_KEY_A_I }, + { L"j", T_KEY_A_J }, + { L"k", T_KEY_A_K }, + { L"l", T_KEY_A_L }, + { L"m", T_KEY_A_M }, + { L"n", T_KEY_A_N }, + { L"o", T_KEY_A_O }, + { L"p", T_KEY_A_P }, + { L"q", T_KEY_A_Q }, + { L"r", T_KEY_A_R }, + { L"s", T_KEY_A_S }, + { L"t", T_KEY_A_T }, + { L"u", T_KEY_A_U }, + { L"v", T_KEY_A_V }, + { L"w", T_KEY_A_W }, + { L"x", T_KEY_A_X }, + { L"y", T_KEY_A_Y }, + { L"z", T_KEY_A_Z }, { NULL, 0 } };