Godot Version
4.4
Question
I am simulating a click event when I press a button on my game controller. The event changes depending on my project size mode. Here is the code:
func _left_mouse_click() -> void:
var joy_click := InputEventMouseButton.new()
joy_click.button_index = MOUSE_BUTTON_LEFT
joy_click.position = get_viewport().get_mouse_position()
joy_click.pressed = true
Input.parse_input_event(joy_click)
In windowed mode this is the event returned:
InputEventMouseButton: button_index=1, mods=none, pressed=true, canceled=false, position=((1291.0, 611.0)), button_mask=0, double_click=false
Maximized, Fullscreen or Exclusive Fullscreen see this:
InputEventMouseMotion: button_mask=1 (Left Mouse Button), position=((1270.53, 638.2177)), relative=((0.0, 0.0)), velocity=((0.0, 0.0)), pressure=0.00, tilt=((0.0, 0.0)), pen_inverted=(false)
The button mask info is enough for me to work around the change in behavior, but I am wondering -
Why would changing Project > Window > Size > Mode change the parsed input event?
In case it is relevant, the project size is 1920 x 1080. My monitor size is 2560 x 1440. The click target is an Area2D with a CollisionShape.