diff options
author | 2012-07-09 09:49:22 -0400 | |
---|---|---|
committer | 2012-07-09 09:49:22 -0400 | |
commit | a1d714eaeec69d359b8de54ac00d0fc621b96fa2 (patch) | |
tree | c0ab27e397150a781efd329750a97ee99a90a5b6 | |
parent | 26d69b89c9f25e1b42c9372966822ab039fe42e2 (diff) | |
download | textadept-a1d714eaeec69d359b8de54ac00d0fc621b96fa2.tar.gz textadept-a1d714eaeec69d359b8de54ac00d0fc621b96fa2.zip |
Ignore Fn-key combinations on Mac OSX.
GTKOSX passes a keycode that confuses Scintilla, which inserts a 'DLE' char.
-rw-r--r-- | core/keys.lua | 6 | ||||
-rw-r--r-- | modules/textadept/keys.lua | 3 |
2 files changed, 7 insertions, 2 deletions
diff --git a/core/keys.lua b/core/keys.lua index be93c18f..d09a0ef5 100644 --- a/core/keys.lua +++ b/core/keys.lua @@ -126,13 +126,13 @@ local error = function(e) events.emit(events.ERROR, e) end -- @class table -- @name KEYSYMS M.KEYSYMS = { - -- from Scintilla.h + -- From Scintilla.h. [300] = 'down', [301] = 'up', [302] = 'left', [303] = 'right', [304] = 'home', [305] = 'end', [306] = 'pgup', [307] = 'pgdn', [308] = 'del', [309] = 'ins', - -- from <gdk/gdkkeysyms.h> + -- From <gdk/gdkkeysyms.h>. [0xFE20] = '\t', -- backtab; will be 'shift'ed [0xFF08] = '\b', [0xFF09] = '\t', @@ -159,6 +159,8 @@ M.KEYSYMS = { [0xFFBE] = 'f1', [0xFFBF] = 'f2', [0xFFC0] = 'f3', [0xFFC1] = 'f4', [0xFFC2] = 'f5', [0xFFC3] = 'f6', [0xFFC4] = 'f7', [0xFFC5] = 'f8', [0xFFC6] = 'f9', [0xFFC7] = 'f10', [0xFFC8] = 'f11', [0xFFC9] = 'f12', + -- Mac OSX. + [16777232] = 'fn', -- GTKOSX does not recognize Fn-key combinations, just this } -- The current key sequence. diff --git a/modules/textadept/keys.lua b/modules/textadept/keys.lua index 4c9d68a0..e3d7eaed 100644 --- a/modules/textadept/keys.lua +++ b/modules/textadept/keys.lua @@ -405,6 +405,9 @@ if OSX or NCURSES then keys.mU = buffer.page_up_extend keys.mD = buffer.page_down_extend end + -- GTKOSX reports Fn-key as a single keycode which confuses Scintilla. Do not + -- propagate it. + keys.fn = function() return true end end return M |