diff options
author | 2008-10-30 14:17:23 -0400 | |
---|---|---|
committer | 2008-10-30 14:17:23 -0400 | |
commit | b7b4c83d44aa6e5af69ca0a33be71ac07dfa8966 (patch) | |
tree | cad103e710897363b9e9625b8ac90e549c04d5dc /core/ext/keys.lua | |
parent | 0a99b9700008a6af352c52b3d9667edea2f5d26b (diff) | |
download | textadept-b7b4c83d44aa6e5af69ca0a33be71ac07dfa8966.tar.gz textadept-b7b4c83d44aa6e5af69ca0a33be71ac07dfa8966.zip |
Work around native GTK-OSX handling of Alt key for composing; core/ext/keys.lua
Diffstat (limited to 'core/ext/keys.lua')
-rw-r--r-- | core/ext/keys.lua | 11 |
1 files changed, 10 insertions, 1 deletions
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] |