It's only alt and alt+shift that dont work in global menubar

alt in combination with ctrl/cmd works fine.
This commit is contained in:
Kovid Goyal 2021-04-22 10:50:43 +05:30
parent b6c1e1a609
commit 36da65120a
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -21,9 +21,9 @@ from .constants import (
is_wayland, kitty_exe, logo_png_file, running_in_kitty
)
from .fast_data_types import (
GLFW_IBEAM_CURSOR, GLFW_MOD_ALT, create_os_window, free_font_data,
glfw_init, glfw_terminate, load_png_data, set_custom_cursor,
set_default_window_icon, set_options
GLFW_IBEAM_CURSOR, GLFW_MOD_ALT, GLFW_MOD_SHIFT, create_os_window,
free_font_data, glfw_init, glfw_terminate, load_png_data,
set_custom_cursor, set_default_window_icon, set_options
)
from .fonts.box_drawing import set_scale
from .fonts.render import set_font_family
@ -112,11 +112,12 @@ def get_macos_shortcut_for(opts: OptionsStub, function: str = 'new_os_window') -
candidates.append(k)
if candidates:
from .fast_data_types import cocoa_set_global_shortcut
alt_mods = GLFW_MOD_ALT, GLFW_MOD_ALT | GLFW_MOD_SHIFT
# Reverse list so that later defined keyboard shortcuts take priority over earlier defined ones
for candidate in reversed(candidates):
if candidate.mods & GLFW_MOD_ALT:
# Option based shortcuts dont work in the global menubar, see
if candidate.mods in alt_mods:
# Option based shortcuts dont work in the global menubar,
# presumably because Apple reserves them for IME, see
# https://github.com/kovidgoyal/kitty/issues/3515
continue
if cocoa_set_global_shortcut(function, candidate[0], candidate[2]):