GHOST/Keymap: support for detecting repeat events

- Keymap items now have 'repeat' boolean which can be set
  to make keymap items respond to key repeat events or not.
- Support for X11 & WIN32 (not macOS currently).

This allows for the possibility to perform actions while a key is held
and finish the action upon release.

Thanks to @Severin for review and WIN32 support.
This commit is contained in:
Campbell Barton
2020-03-06 17:24:12 +11:00
parent 73ef27f156
commit 5be0e3430d
16 changed files with 165 additions and 17 deletions

View File

@@ -184,6 +184,9 @@ def draw_kmi(display_keymaps, kc, km, kmi, layout, level):
if map_type == 'KEYBOARD':
subrow.prop(kmi, "type", text="", event=True)
subrow.prop(kmi, "value", text="")
subrow_repeat = subrow.row(align=True)
subrow_repeat.active = kmi.value in {'ANY', 'PRESS'}
subrow_repeat.prop(kmi, "repeat", text="Repeat")
elif map_type in {'MOUSE', 'NDOF'}:
subrow.prop(kmi, "type", text="")
subrow.prop(kmi, "value", text="")