Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2019-11-26 16:34:46 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-11-26 16:43:33 +0300
commit939e4030b1168cacf0d0f8f64a1ed51c535e397c (patch)
tree490184cf8cb1f4abad38c6d8eba2b790e9cbfb02 /release/scripts/modules
parentfcbec6e97e649eee33f06e0202455ee11dcfe46e (diff)
Fix T64655: Quad view toggle conflicts on macOS
Cmd-Alt-Q is a system shortcut on macOS, use Ctrl-Alt-Q.
Diffstat (limited to 'release/scripts/modules')
-rw-r--r--release/scripts/modules/bl_keymap_utils/platform_helpers.py32
1 files changed, 19 insertions, 13 deletions
diff --git a/release/scripts/modules/bl_keymap_utils/platform_helpers.py b/release/scripts/modules/bl_keymap_utils/platform_helpers.py
index 064c8b1d171..e18a902c562 100644
--- a/release/scripts/modules/bl_keymap_utils/platform_helpers.py
+++ b/release/scripts/modules/bl_keymap_utils/platform_helpers.py
@@ -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):
"""Use for apple since Cmd is typically used in-place of Ctrl."""
def filter_fn(item_event):
- if (item_event["type"] in {
- 'H',
- 'M',
- 'SPACE',
- 'W',
- 'ACCENT_GRAVE',
- 'PERIOD',
- }) and (
- item_event.get("ctrl") and
- (not item_event.get("alt")) and
- (not item_event.get("shift"))
- ):
- return False
+ if item_event.get("ctrl"):
+ event_type = item_event["type"]
+ # Ctrl-{Key}
+ if (event_type in {
+ 'H',
+ 'M',
+ 'SPACE',
+ 'W',
+ 'ACCENT_GRAVE',
+ 'PERIOD',
+ }):
+ if (not item_event.get("alt")) and (not item_event.get("shift")):
+ 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 keyconfig_data_oskey_from_ctrl(keyconfig_data_src, filter_fn)