Skip to content

Commit

Permalink
Fix tool shortcuts not working with Control
Browse files Browse the repository at this point in the history
Addresses #935
  • Loading branch information
OverloadedOrama committed Nov 6, 2023
1 parent 0e5cc58 commit 5b67880
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/UI/Tools/ToolButtons.gd
Original file line number Diff line number Diff line change
Expand Up @@ -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.is_command_or_control_pressed())
):
if event.is_action_pressed("right_" + t.shortcut + "_tool", false, true):
# Shortcut for right button (with Alt)
Tools.assign_tool(t.name, MOUSE_BUTTON_RIGHT)
return
if InputMap.has_action("left_" + t.shortcut + "_tool"):
if (
event.is_action_pressed("left_" + t.shortcut + "_tool")
and (!event.is_command_or_control_pressed())
):
if event.is_action_pressed("left_" + t.shortcut + "_tool", false, true):
# Shortcut for left button
Tools.assign_tool(t.name, MOUSE_BUTTON_LEFT)
return
Expand Down

0 comments on commit 5b67880

Please sign in to comment.