From b7b4c83d44aa6e5af69ca0a33be71ac07dfa8966 Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Thu, 30 Oct 2008 14:17:23 -0400 Subject: Work around native GTK-OSX handling of Alt key for composing; core/ext/keys.lua --- core/ext/keys.lua | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'core/ext/keys.lua') diff --git a/core/ext/keys.lua b/core/ext/keys.lua index b87b27de..7b62c151 100644 --- a/core/ext/keys.lua +++ b/core/ext/keys.lua @@ -130,7 +130,16 @@ local function keypress(code, shift, control, alt) local key --print(code, string.char(code)) if code < 256 then - key = string.char(code):lower() + key_seq = key_seq..string.char(code):lower() + if MAC and not shift and not control and not alt then + local ch = string.char(code) + -- work around native GTK-OSX's handling of Alt key + if ch:match('[^A-Za-z ]') then + buffer:add_text(ch) + textadept.events.handle('char_added', ch) + return true + end + end else if not KEYSYMS[code] then return end key = KEYSYMS[code] -- cgit v1.2.3