Keymap: pressing leader key (Alt) again closes tool prompt

Provides a convenient way to close
if the tool prompt is opened by accident.
This commit is contained in:
2019-11-15 13:52:16 +11:00
parent 8863fc65ca
commit b6973ed760

View File

@@ -1843,6 +1843,13 @@ class WM_OT_toolbar_prompt(Operator):
context.workspace.status_text_set(None)
return {'FINISHED'}
# Pressing entry even again exists, as long as it's not mapped to a key (for convenience).
if event_type == self._init_event_type:
if event_value == 'RELEASE':
if not (event.ctrl or event.alt or event.shift or event.oskey):
context.workspace.status_text_set(None)
return {'CANCELLED'}
return {'RUNNING_MODAL'}
def invoke(self, context, event):