W3cubDocs

/Godot 2.1

InputEventMouseMotion

Category: Built-In Types

Brief Description

Built-in input event type for mouse motion events.

Member Functions

bool is_action ( String action )
bool is_action_pressed ( String action )
bool is_action_released ( String action )
bool is_echo ( )
bool is_pressed ( )
void set_as_action ( String action, bool pressed )

Member Variables

  • int ID - Event identifier, positive integer increased at each new event.
  • bool alt - State of the Alt modifier.
  • int button_mask - Mouse button mask identifier, one of or a bitwise combination of the BUTTON_MASK_* constants in [@Global Scope].
  • bool control - State of the Ctrl modifier.
  • int device - Device identifier.
  • Vector2 global_pos - Global position of the mouse pointer.
  • int global_x - Global X coordinate of the mouse pointer.
  • int global_y - Global Y coordinate of the mouse pointer.
  • bool meta - State of the Meta modifier.
  • Vector2 pos - Local position of the mouse pointer.
  • Vector2 relative_pos - Position of the mouse pointer relative to the previous mouse position.
  • int relative_x - X coordinate of the mouse pointer relative to the previous mouse position.
  • int relative_y - Y coordinate of the mouse pointer relative to the previous mouse position.
  • bool shift - State of the Shift modifier.
  • Vector2 speed - Speed of the mouse pointer.
  • float speed_x - Speed of the mouse pointer on the X axis.
  • float speed_y - Speed of the mouse pointer on the Y axis.
  • int type - Type of event (one of the [InputEvent] constants).
  • int x - Local X coordinate of the mouse pointer.
  • int y - Local Y coordinate of the mouse pointer.

Numeric Constants

  • NONE = 0 — Empty input event.
  • KEY = 1 — Key event.
  • MOUSE_MOTION = 2 — Mouse motion event.
  • MOUSE_BUTTON = 3 — Mouse button event.
  • JOYSTICK_MOTION = 4 — Joystick motion event.
  • JOYSTICK_BUTTON = 5 — Joystick button event.
  • SCREEN_TOUCH = 6 — Screen touch event.
  • SCREEN_DRAG = 7 — Screen drag event.
  • ACTION = 8 — Pre-defined action event (see InputMap).

Description

Input event type for mouse motion events that extends the global InputEvent type.

Member Function Description

bool is_action ( String action )

Return if this input event matches a pre-defined action.

bool is_action_pressed ( String action )

Return whether the given action is being pressed. Not relevant for MOUSE_MOTION events, always false.

bool is_action_released ( String action )

Return whether the given action is released (i.e. not pressed). Not relevant for MOUSE_MOTION events, can be true or false depending on whether is_action is true.

bool is_echo ( )

Return if this input event is an echo event (only for events of type KEY, i.e. always false for this type).

bool is_pressed ( )

Return if this input event is pressed. Not relevant for MOUSE_MOTION events, always false.

void set_as_action ( String action, bool pressed )

Change the input event to an action event of the given name with the (irrelevant for this type) pressed status passed as argument.

© 2014–2017 Juan Linietsky, Ariel Manzur, Godot Engine contributors
Licensed under the MIT License.
http://docs.godotengine.org/en/2.1/classes/class_inputeventmousemotion.html