mirror of
https://github.com/Orama-Interactive/Pixelorama.git
synced 2025-01-18 17:19:50 +00:00
Tool shortcuts should ignore macOS Command modifier. (#784)
* Tool shortcuts should ignore macOS Command modifier. This prevents common shortcuts like CMD+S (Save), CMD+C (Copy), etc, from activating a tool. * Fix formatting Co-authored-by: Emmanouil Papadeas <35376950+OverloadedOrama@users.noreply.github.com>
This commit is contained in:
parent
fc5497861a
commit
c4059beddf
|
@ -13,12 +13,18 @@ func _input(event: InputEvent) -> void:
|
|||
for tool_name in Tools.tools: # Handle tool shortcuts
|
||||
var t: Tools.Tool = Tools.tools[tool_name]
|
||||
if InputMap.has_action("right_" + t.shortcut + "_tool"):
|
||||
if event.is_action_pressed("right_" + t.shortcut + "_tool") and !event.control:
|
||||
if (
|
||||
event.is_action_pressed("right_" + t.shortcut + "_tool")
|
||||
and (!event.control and !event.command)
|
||||
):
|
||||
# Shortcut for right button (with Alt)
|
||||
Tools.assign_tool(t.name, BUTTON_RIGHT)
|
||||
return
|
||||
if InputMap.has_action("left_" + t.shortcut + "_tool"):
|
||||
if event.is_action_pressed("left_" + t.shortcut + "_tool") and !event.control:
|
||||
if (
|
||||
event.is_action_pressed("left_" + t.shortcut + "_tool")
|
||||
and (!event.control and !event.command)
|
||||
):
|
||||
# Shortcut for left button
|
||||
Tools.assign_tool(t.name, BUTTON_LEFT)
|
||||
return
|
||||
|
|
Loading…
Reference in a new issue