diff options
-rw-r--r-- | core/keys.lua | 2 | ||||
-rw-r--r-- | src/textadept.c | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/core/keys.lua b/core/keys.lua index 6d5efa93..e3ed5d73 100644 --- a/core/keys.lua +++ b/core/keys.lua @@ -224,7 +224,7 @@ local function keypress(code, shift, control, alt, meta) local key --print(code, M.KEYSYMS[code], shift, control, alt, meta) if code < 256 then - key = string_char(code) + key = (not NCURSES or code ~= 7) and string_char(code) or 'esc' shift = shift and code < 32 -- for printable characters, key is upper case else key = M.KEYSYMS[code] diff --git a/src/textadept.c b/src/textadept.c index 4d430c8a..72e8af67 100644 --- a/src/textadept.c +++ b/src/textadept.c @@ -2315,10 +2315,10 @@ int main(int argc, char **argv) { TermKeyResult res; TermKeyKey key; int keysyms[] = { - 0, SCK_BACK, SCK_TAB, SCK_RETURN, 0xFF1B /* GDK esc */, 0, 0, SCK_UP, - SCK_DOWN, SCK_LEFT, SCK_RIGHT, 0, 0, SCK_INSERT, SCK_DELETE, 0, SCK_PRIOR, - SCK_NEXT, SCK_HOME, SCK_END - }; // note: use GDK keysym value for esc for now + 0, SCK_BACK, SCK_TAB, SCK_RETURN, SCK_ESCAPE, 0, 0, SCK_UP, SCK_DOWN, + SCK_LEFT, SCK_RIGHT, 0, 0, SCK_INSERT, SCK_DELETE, 0, SCK_PRIOR, SCK_NEXT, + SCK_HOME, SCK_END + }; int c = 0; while ((res = termkey_waitkey(tk, &key)) != TERMKEY_RES_EOF) { if (res == TERMKEY_RES_ERROR) continue; |