WM: use spacebar press event (not double click)

Functionality) is nicer but this uses a hack to make it work,
keep the code under a variable in case we want to remove.
This commit is contained in:
Campbell Barton
2018-11-15 17:12:33 +11:00
parent 02a21420e8
commit 7c03365861
2 changed files with 35 additions and 1 deletions

View File

@@ -746,6 +746,8 @@ def keymap_from_context(context, space_type):
if ToolSelectPanelHelper._tool_get_by_name(context, space_type, tap_reset_tool)[1] is None:
use_tap_reset = False
from bl_operators.wm import use_toolbar_release_hack
# Pie-menu style release to activate.
use_release_confirm = True
@@ -816,7 +818,7 @@ def keymap_from_context(context, space_type):
if kmi_toolbar_tuple not in kmi_unique_args:
kmi = keymap.keymap_items.new(
"wm.tool_set_by_name",
value='DOUBLE_CLICK',
value='PRESS' if use_toolbar_release_hack else 'DOUBLE_CLICK',
**kmi_toolbar_args,
)
kmi.properties.name = tap_reset_tool
@@ -1013,6 +1015,15 @@ def keymap_from_context(context, space_type):
)
kmi.properties.skip_depressed = True
if use_toolbar_release_hack:
# ... or pass through to let the toolbar know we're released.
# Let the operator know we're released.
kmi = keymap.keymap_items.new(
"wm.tool_set_by_name",
type=kmi_toolbar_type,
value='RELEASE',
)
wm.keyconfigs.update()
return keymap