Work in progress

Godot documentation is being updated to reflect the latest changes in version 4.0. Some documentation pages may still state outdated information. This banner will tell you if you're reading one of such pages.

The contents of this page are up to date. If you can still find outdated information, please open an issue.

InputEventMouse

Inherits: InputEventWithModifiers < InputEventFromWindow < InputEvent < Resource < RefCounted < Object

Inherited By: InputEventMouseButton, InputEventMouseMotion

Base input event type for mouse events.

Description

Stores general mouse events information.

Tutorials

Properties

MouseButtonMask

button_mask

0

Vector2

global_position

Vector2(0, 0)

Vector2

position

Vector2(0, 0)


Property Descriptions

MouseButtonMask button_mask = 0

The mouse button mask identifier, one of or a bitwise combination of the MouseButton button masks.


Vector2 global_position = Vector2(0, 0)

  • void set_global_position ( Vector2 value )

  • Vector2 get_global_position ( )

When received in Node._input or Node._unhandled_input, returns the mouse's position in the root Viewport using the coordinate system of the root Viewport.

When received in Control._gui_input, returns the mouse's position in the CanvasLayer that the Control is in using the coordinate system of the CanvasLayer.


Vector2 position = Vector2(0, 0)

When received in Node._input or Node._unhandled_input, returns the mouse's position in the Viewport this Node is in using the coordinate system of this Viewport.

When received in Control._gui_input, returns the mouse's position in the Control using the local coordinate system of the Control.