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>2020-10-22 04:29:45 +0300
committerCampbell Barton <ideasman42@gmail.com>2020-10-22 04:29:45 +0300
commitf5080c82dd915db6c7b9dd68a52aaaccf2600137 (patch)
treee770697b8d5ae225bcadf8545338ba4c9219cc5b /release/scripts/modules
parent358a584985c01689726f0953f84f002fcdb4d2ed (diff)
Keymap: disable 'repeat' by default for keymap items
In practice, there are only a limited number of operations we need to use repeat such as navigation, stepping operations that cycle states and text input. Now we don't need to disable repeat explicitly when a modal operator uses checks for a key being held as was needed for 17cb2a6da0c88. Repeat is now included in exported keymaps. Use versioning so existing exported keymaps are loaded properly.
Diffstat (limited to 'release/scripts/modules')
-rw-r--r--release/scripts/modules/bl_keymap_utils/io.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/release/scripts/modules/bl_keymap_utils/io.py b/release/scripts/modules/bl_keymap_utils/io.py
index 96f45cd9875..e850661d6c6 100644
--- a/release/scripts/modules/bl_keymap_utils/io.py
+++ b/release/scripts/modules/bl_keymap_utils/io.py
@@ -73,6 +73,11 @@ def kmi_args_as_data(kmi):
if kmi.key_modifier and kmi.key_modifier != 'NONE':
s.append(f"\"key_modifier\": '{kmi.key_modifier}'")
+ if kmi.repeat:
+ if kmi.map_type == 'KEYBOARD':
+ if kmi.value in {'PRESS', 'ANY'}:
+ s.append("\"repeat\": True")
+
return "{" + ", ".join(s) + "}"