1
0
Fork 0
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:
Arron Washington 2022-11-30 10:06:03 -05:00 committed by GitHub
parent fc5497861a
commit c4059beddf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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