summaryrefslogtreecommitdiff
path: root/im.h
diff options
context:
space:
mode:
authorHaoran S. Diao (刁浩然) <0@hairydiode.xyz>2025-09-12 22:33:39 -0700
committerHaoran S. Diao (刁浩然) <0@hairydiode.xyz>2025-09-12 22:33:39 -0700
commit9a6954f9720784bc79668bcc6456f6a3f6a0c5a1 (patch)
treec605b3dab85848841a779bc8b0f864d67464ab6f /im.h
parent9f80defcd51d2c429de55e1209dfa8f6fd22bc69 (diff)
Made it so pressing escape twice sends an escape to the IM, fixed the status
line persisting even on exit. Refactored main process exit
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;