-// Misc. non-Ascii keys that report an escape sequence
-#define VI_K_UP (char)128 // cursor key Up
-#define VI_K_DOWN (char)129 // cursor key Down
-#define VI_K_RIGHT (char)130 // Cursor Key Right
-#define VI_K_LEFT (char)131 // cursor key Left
-#define VI_K_HOME (char)132 // Cursor Key Home
-#define VI_K_END (char)133 // Cursor Key End
-#define VI_K_INSERT (char)134 // Cursor Key Insert
-#define VI_K_DELETE (char)135 // Cursor Key Insert
-#define VI_K_PAGEUP (char)136 // Cursor Key Page Up
-#define VI_K_PAGEDOWN (char)137 // Cursor Key Page Down
-#define VI_K_FUN1 (char)138 // Function Key F1
-#define VI_K_FUN2 (char)139 // Function Key F2
-#define VI_K_FUN3 (char)140 // Function Key F3
-#define VI_K_FUN4 (char)141 // Function Key F4
-#define VI_K_FUN5 (char)142 // Function Key F5
-#define VI_K_FUN6 (char)143 // Function Key F6
-#define VI_K_FUN7 (char)144 // Function Key F7
-#define VI_K_FUN8 (char)145 // Function Key F8
-#define VI_K_FUN9 (char)146 // Function Key F9
-#define VI_K_FUN10 (char)147 // Function Key F10
-#define VI_K_FUN11 (char)148 // Function Key F11
-#define VI_K_FUN12 (char)149 // Function Key F12
+// "Keycodes" that report an escape sequence.
+// We use something which fits into signed char,
+// yet doesn't represent any valid Unicode characher.
+enum {
+ VI_K_UP = -1, // cursor key Up
+ VI_K_DOWN = -2, // cursor key Down
+ VI_K_RIGHT = -3, // Cursor Key Right
+ VI_K_LEFT = -4, // cursor key Left
+ VI_K_HOME = -5, // Cursor Key Home
+ VI_K_END = -6, // Cursor Key End
+ VI_K_INSERT = -7, // Cursor Key Insert
+ VI_K_DELETE = -8, // Cursor Key Insert
+ VI_K_PAGEUP = -9, // Cursor Key Page Up
+ VI_K_PAGEDOWN = -10, // Cursor Key Page Down
+ VI_K_FUN1 = -11, // Function Key F1
+ VI_K_FUN2 = -12, // Function Key F2
+ VI_K_FUN3 = -13, // Function Key F3
+ VI_K_FUN4 = -14, // Function Key F4
+ VI_K_FUN5 = -15, // Function Key F5
+ VI_K_FUN6 = -16, // Function Key F6
+ VI_K_FUN7 = -17, // Function Key F7
+ VI_K_FUN8 = -18, // Function Key F8
+ VI_K_FUN9 = -19, // Function Key F9
+ VI_K_FUN10 = -20, // Function Key F10
+ VI_K_FUN11 = -21, // Function Key F11
+ VI_K_FUN12 = -22, // Function Key F12
+};