From 9a6954f9720784bc79668bcc6456f6a3f6a0c5a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Haoran=20S=2E=20Diao=20=28=E5=88=81=E6=B5=A9=E7=84=B6=29?= <0@hairydiode.xyz> Date: Fri, 12 Sep 2025 22:33:39 -0700 Subject: Made it so pressing escape twice sends an escape to the IM, fixed the status line persisting even on exit. Refactored main process exit --- im.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'im.h') 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; -- cgit v1.1