diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-02-20 06:29:29 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-02-20 06:37:15 +0300 |
commit | effe750ec103d56ff96f12ce64ac977a8ae51909 (patch) | |
tree | fd081fdade0458fa388b55d277034aa38588d146 /source/blender/windowmanager/wm_event_system.h | |
parent | 855b3e68ef272f6ddb3b496cf8e6d074733e99d4 (diff) |
WM: support dynamic keymap handlers
Add getter callback support for 'WM_HANDLER_TYPE_KEYMAP' type handlers
this is needed for key-maps which change based on the active tool.
Replaces 'sneaky_handler' hack which temporarily inserted a handler.
Diffstat (limited to 'source/blender/windowmanager/wm_event_system.h')
-rw-r--r-- | source/blender/windowmanager/wm_event_system.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/windowmanager/wm_event_system.h b/source/blender/windowmanager/wm_event_system.h index ab59f52f125..cd7a5102809 100644 --- a/source/blender/windowmanager/wm_event_system.h +++ b/source/blender/windowmanager/wm_event_system.h @@ -68,6 +68,12 @@ typedef struct wmEventHandler_Keymap { /** Run after the keymap item runs. */ struct wmEventHandler_KeymapFn keymap_callback; + /** Support for a getter function that looks up the keymap each access. */ + struct { + wmEventHandler_KeymapDynamicFn *keymap_fn; + void *user_data; + } dynamic; + struct bToolRef *keymap_tool; } wmEventHandler_Keymap; |