diff options
-rw-r--r-- | core/keys.lua | 5 | ||||
-rw-r--r-- | src/textadept.c | 2 |
2 files changed, 5 insertions, 2 deletions
diff --git a/core/keys.lua b/core/keys.lua index 40502501..88ee1165 100644 --- a/core/keys.lua +++ b/core/keys.lua @@ -275,7 +275,10 @@ local function get_gdk_key(key_seq) local byte = string_byte(key) if #key > 1 or byte < 32 then for i, s in pairs(M.KEYSYMS) do - if s == key and i ~= 0xFE20 then byte = i break end + if s == key and i ~= 0xFE20 and (i > 0xFE20 or NCURSES) then + byte = i + break + end end end return byte, modifiers diff --git a/src/textadept.c b/src/textadept.c index 315134f8..851bf3d1 100644 --- a/src/textadept.c +++ b/src/textadept.c @@ -863,7 +863,7 @@ static void l_pushmenu(lua_State *L, int index, GCallback callback, if (label) { menu_item = (*label) ? gtk_menu_item_new_with_mnemonic(label) : gtk_separator_menu_item_new(); - if (key || modifiers) + if (*label && key > 0) gtk_widget_add_accelerator(menu_item, "activate", accel, key, modifiers, GTK_ACCEL_VISIBLE); g_signal_connect(menu_item, "activate", callback, |