summaryrefslogtreecommitdiff
path: root/im.h
diff options
context:
space:
mode:
Diffstat (limited to 'im.h')
-rw-r--r--im.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/im.h b/im.h
index d92191c..47ae538 100644
--- a/im.h
+++ b/im.h
@@ -16,10 +16,10 @@
//the one you desire
#define BACKSPACE_KEY 0x7F
#define BACKSPACE_KEY_2 0x08
-//setting it to the actual escape character interferes with arrow keys and
-//whatnot
-//#define ESCAPE_KEY 0x1B
+//the literal escape char is only fed into the im if it is pressed twice, see
+//escape.h
#define ESCAPE_KEY '`'
+#define ESCAPE_KEY_2 0x1B
//Vertical Tab Ctrl+K
#define TOGGLE_KEY 0x0B
#define IM_KEY_RANGE_LEN 3
@@ -146,6 +146,7 @@ int update_im_state(char input, char * output) {
if (im_buffer_pos > 0) {
switch (input) {
//escape, cancels
+ case ESCAPE_KEY_2:
case ESCAPE_KEY:
clear_im_buffer();
return 0;