8000 BlockCanvas: Use _gui_input instead of _input · endlessm/godot-block-coding@7fe27a5 · GitHub
[go: up one dir, main page]

Skip to content

Commit 7fe27a5

Browse files
committed
BlockCanvas: Use _gui_input instead of _input
Use the _gui_input virtual function to pan and zoom the block canvas, instead of _input. This way, events are filtered according to the block canvas's visibility. As a side-effect, the block canvas processes input events after any containing widgets. For example, middle clicking inside a parameter input component will no longer begin panning. However, this is a better situation than the block canvas handling input events regardless of its visibility. Closes: #184
1 parent bf775de commit 7fe27a5

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

addons/block_code/ui/block_canvas/block_canvas.gd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ func _on_replace_block_code_button_pressed():
364364
replace_block_code.emit()
365365

366366

367-
func _input(event):
367+
func _gui_input(event):
368368
if event is InputEventKey:
369369
if event.keycode == KEY_SHIFT:
370370
set_mouse_override(event.pressed)

addons/block_code/ui/blocks/utilities/drag_drop_area/drag_drop_area.gd

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ func _gui_input(event: InputEvent) -> void:
4444

4545
func _input(event: InputEvent) -> void:
4646
# Watch for mouse movements using _input. This way, we receive mouse
47-
# movement events that occur outside of the component.
47+
# motion events that occur outside of the component before the GUI system
48+
# does.
4849

4950
if not event is InputEventMouseMotion:
5051
return

0 commit comments

Comments
 (0)
0