1
0
Fork 0
mirror of https://github.com/Orama-Interactive/Pixelorama.git synced 2025-02-21 13:03:13 +00:00

Fix tool shortcuts not working with Control

Addresses #935
This commit is contained in:
Emmanouil Papadeas 2023-11-06 02:34:53 +02:00
parent 1317e40ffa
commit 7c0de64b92

View file

@ -15,18 +15,12 @@ func _input(event: InputEvent) -> void:
continue
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 and !event.command)
):
if event.is_action_pressed("right_" + t.shortcut + "_tool", false, true):
# 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 and !event.command)
):
if event.is_action_pressed("left_" + t.shortcut + "_tool", false, true):
# Shortcut for left button
Tools.assign_tool(t.name, BUTTON_LEFT)
return