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:
authorJoseph Eagar <joeedh@gmail.com>2021-09-18 06:13:39 +0300
committerJoseph Eagar <joeedh@gmail.com>2021-09-18 06:13:39 +0300
commitf0c35d16f39d837c7bceb6740d3fe9c440676564 (patch)
treee88f2b8ef0a2999cb45a7c83d5e88d1aa6df0044 /release/scripts/modules/bl_keymap_utils/io.py
parentd3bba94bf243c82b0c94b176f0541511e29bbcf3 (diff)
parent6cf734a2e5d2496d1b2d33bc7613b56a9f9fc2ec (diff)
Merge branch 'master' into temp_bmesh_multirestemp_bmesh_multires
Diffstat (limited to 'release/scripts/modules/bl_keymap_utils/io.py')
-rw-r--r--release/scripts/modules/bl_keymap_utils/io.py15
1 files changed, 5 insertions, 10 deletions
diff --git a/release/scripts/modules/bl_keymap_utils/io.py b/release/scripts/modules/bl_keymap_utils/io.py
index 96832cbd9c7..d8b68822feb 100644
--- a/release/scripts/modules/bl_keymap_utils/io.py
+++ b/release/scripts/modules/bl_keymap_utils/io.py
@@ -63,16 +63,11 @@ def kmi_args_as_data(kmi):
if kmi.any:
s.append("\"any\": True")
else:
- if kmi.shift:
- s.append("\"shift\": True")
- if kmi.ctrl:
- s.append("\"ctrl\": True")
- if kmi.alt:
- s.append("\"alt\": True")
- if kmi.oskey:
- s.append("\"oskey\": True")
- if kmi.key_modifier and kmi.key_modifier != 'NONE':
- s.append(f"\"key_modifier\": '{kmi.key_modifier}'")
+ for attr in ("shift", "ctrl", "alt", "oskey"):
+ if mod := getattr(kmi, attr):
+ s.append(f"\"{attr:s}\": " + ("-1" if mod == -1 else "True"))
+ if (mod := kmi.key_modifier) and (mod != 'NONE'):
+ s.append(f"\"key_modifier\": '{mod:s}'")
if kmi.repeat:
if (