Fix T64655: Quad view toggle conflicts on macOS

Cmd-Alt-Q is a system shortcut on macOS, use Ctrl-Alt-Q.
This commit is contained in:
2019-11-27 00:34:46 +11:00
parent fcbec6e97e
commit 939e4030b1

View File

@@ -39,19 +39,25 @@ def keyconfig_data_oskey_from_ctrl(keyconfig_data_src, filter_fn=None):
def keyconfig_data_oskey_from_ctrl_for_macos(keyconfig_data_src): def keyconfig_data_oskey_from_ctrl_for_macos(keyconfig_data_src):
"""Use for apple since Cmd is typically used in-place of Ctrl.""" """Use for apple since Cmd is typically used in-place of Ctrl."""
def filter_fn(item_event): def filter_fn(item_event):
if (item_event["type"] in { if item_event.get("ctrl"):
'H', event_type = item_event["type"]
'M', # Ctrl-{Key}
'SPACE', if (event_type in {
'W', 'H',
'ACCENT_GRAVE', 'M',
'PERIOD', 'SPACE',
}) and ( 'W',
item_event.get("ctrl") and 'ACCENT_GRAVE',
(not item_event.get("alt")) and 'PERIOD',
(not item_event.get("shift")) }):
): if (not item_event.get("alt")) and (not item_event.get("shift")):
return False return False
# Ctrl-Alt-{Key}
if (event_type in {
'Q',
}):
if item_event.get("alt") and (not item_event.get("shift")):
return False
return True return True
return keyconfig_data_oskey_from_ctrl(keyconfig_data_src, filter_fn) return keyconfig_data_oskey_from_ctrl(keyconfig_data_src, filter_fn)