From 69c8b583e7b7c31e9316a24f185ca99f9452d91d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Fri, 8 Jul 2016 23:08:53 +0200 Subject: [PATCH] classref: Add docs for InputEvent* and InputMap --- doc/base/classes.xml | 252 +++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 241 insertions(+), 11 deletions(-) diff --git a/doc/base/classes.xml b/doc/base/classes.xml index c77a3c7a45c..cffbd68939f 100644 --- a/doc/base/classes.xml +++ b/doc/base/classes.xml @@ -15946,8 +15946,10 @@ + Default implementation of the [Input] class. + Default implementation of the [Input] class, used internally by the editor and games for default input management. @@ -15959,7 +15961,7 @@ Built-in input event data. - Built-in input event data. InputEvent is a built-in engine datatype, given that it's passed around and used so much. Depending on it's type, the members contained can be different, so read the documentation well!. Input events can also represent actions (editable from the project settings). + Built-in input event data. InputEvent is a built-in engine datatype, given that it's passed around and used so much. Depending on its type, the members contained can be different, so read the documentation well! Input events can also represent actions (editable from the project settings). @@ -15977,6 +15979,7 @@ + Return whether the given action is being pressed (and is not an echo event for KEY events). Not relevant for the event types MOUSE_MOTION, SCREEN_DRAG and NONE. @@ -15985,20 +15988,21 @@ + Return whether the given action is released (i.e. not pressed). Not relevant for the event types MOUSE_MOTION, SCREEN_DRAG and NONE. - Return if this input event is an echo event (usually for key events). + Return if this input event is an echo event (only for events of type KEY, it will return false for other types). - Return if this input event is pressed (for key, mouse, joy button or screen press events). + Return if this input event is pressed. Not relevant for the event types MOUSE_MOTION, SCREEN_DRAG and NONE. @@ -16007,15 +16011,19 @@ + Change the input event to an action event of the given name, regardless of its initial type, with the pressed status passed as argument. + Event identifier, positive integer increased at each new event. + Device identifier. + Type of event (one of the [InputEvent] constants). @@ -16038,17 +16046,22 @@ Joystick button event. + Screen touch event. + Screen drag event. + Pre-defined action event (see [InputMap]). + Built-in input event type for actions. + Input event type for actions that extends the global [InputEvent] type. @@ -16057,6 +16070,7 @@ + Return if this input event matches a pre-defined action, i.e. always true for InputEventAction. @@ -16065,6 +16079,7 @@ + Return whether the given action is being pressed. @@ -16073,18 +16088,21 @@ + Return whether the given action is released (i.e. not pressed). + Return if this input event is an echo event (only for events of type KEY, i.e. always false for this type). + Return if this input event is pressed. @@ -16093,42 +16111,57 @@ + Change the input event to an action event of the given name with the pressed status passed as argument. + Event identifier, positive integer increased at each new event. + Device identifier. + Type of event (one of the [InputEvent] constants). + Empty input event. + Key event. + Mouse motion event. + Mouse button event. + Joystick motion event. + Joystick button event. + Screen touch event. + Screen drag event. + Pre-defined action event (see [InputMap]). + Built-in input event type for joystick button events. + Input event type for joystick button events that extends the global [InputEvent] type. @@ -16137,6 +16170,7 @@ + Return if this input event matches a pre-defined action. @@ -16145,6 +16179,7 @@ + Return whether the given action is being pressed. @@ -16153,18 +16188,21 @@ + Return whether the given action is released (i.e. not pressed). + Return if this input event is an echo event (only for events of type KEY, i.e. always false for this type). + Return if this input event is pressed. @@ -16173,48 +16211,66 @@ + Change the input event to an action event of the given name with the pressed status passed as argument. + Event identifier, positive integer increased at each new event. + Joystick button identifier, one of the JOY_BUTTON_* constants in [@Global Scope]. + Device identifier. + Pressed state of the joystick button. + Intensity of the button pressure, ranges from 0 to 1.0. + Type of event (one of the [InputEvent] constants). + Empty input event. + Key event. + Mouse motion event. + Mouse button event. + Joystick motion event. + Joystick button event. + Screen touch event. + Screen drag event. + Pre-defined action event (see [InputMap]). + Built-in input event type for joystick motion/axis events. + Input event type for joystick motion/axis events that extends the global [InputEvent] type. @@ -16231,6 +16287,7 @@ + Return whether the given action is being pressed. @@ -16239,18 +16296,21 @@ + Return whether the given action is released (i.e. not pressed). + Return if this input event is an echo event (only for events of type KEY, i.e. always false for this type). + Return if this input event is pressed. @@ -16259,46 +16319,63 @@ + Change the input event to an action event of the given name with the pressed status passed as argument. + Event identifier, positive integer increased at each new event. + Joystick axis identifier, one of the JOY_AXIS_* constants in [@Global Scope]. + Device identifier. + Type of event (one of the [InputEvent] constants). + Position of the axis, ranging from -1.0 to 1.0. A value of 0 means that the axis is in its neutral position. + Empty input event. + Key event. + Mouse motion event. + Mouse button event. + Joystick motion event. + Joystick button event. + Screen touch event. + Screen drag event. + Pre-defined action event (see [InputMap]). + Built-in input event type for keyboard events. + Input event type for keyboard events that extends the global [InputEvent] type. @@ -16307,6 +16384,7 @@ + Return if this input event matches a pre-defined action. @@ -16315,6 +16393,7 @@ + Return whether the given action is being pressed. @@ -16323,18 +16402,21 @@ + Return whether the given action is released (i.e. not pressed). + Return if this input event is an echo event. + Return if this input event is pressed. @@ -16343,58 +16425,81 @@ + Change the input event to an action event of the given name with the pressed status passed as argument. + Event identifier, positive integer increased at each new event. + State of the Alt modifier. + State of the Ctrl modifier. + Device identifier. + Echo state of the key, i.e. whether it's a repeat event or not. + State of the Meta modifier. + Pressed state of the key. + Scancode of the key, one of the KEY_* constants in [@Global Scope]. + State of the Shift modifier. + Type of event (one of the [InputEvent] constants). + Unicode identifier of the key (when relevant). + Empty input event. + Key event. + Mouse motion event. + Mouse button event. + Joystick motion event. + Joystick button event. + Screen touch event. + Screen drag event. + Pre-defined action event (see [InputMap]). + Built-in input event type for mouse button events. + Input event type for mouse button events that extends the global [InputEvent] type. @@ -16403,6 +16508,7 @@ + Return if this input event matches a pre-defined action. @@ -16411,6 +16517,7 @@ + Return whether the given action is being pressed. @@ -16419,18 +16526,21 @@ + Return whether the given action is released (i.e. not pressed). + Return if this input event is an echo event (only for events of type KEY, i.e. always false for this type). + Return if this input event is pressed. @@ -16439,70 +16549,99 @@ + Change the input event to an action event of the given name with the pressed status passed as argument. + Event identifier, positive integer increased at each new event. + State of the Alt modifier. + Mouse button identifier, one of the BUTTON_* or BUTTON_WHEEL_* constants in [@Global Scope]. + Mouse button mask identifier, one of or a bitwise combination of the BUTTON_MASK_* constants in [@Global Scope]. + State of the Control modifier. + Device identifier. + Whether the event is a double-click. + Global position of the mouse click. + Global X coordinate of the mouse click. + Global Y coordinate of the mouse click. + State of the Meta modifier. + Local position of the mouse click. + Pressed state of the mouse button. + State of the Shift modifier. + Type of event (one of the [InputEvent] constants). + Local X coordinate of the mouse click. + Local Y coordinate of the mouse click. + Empty input event. + Key event. + Mouse motion event. + Mouse button event. + Joystick motion event. + Joystick button event. + Screen touch event. + Screen drag event. + Pre-defined action event (see [InputMap]). + Built-in input event type for mouse motion events. + Input event type for mouse motion events that extends the global [InputEvent] type. @@ -16511,6 +16650,7 @@ + Return if this input event matches a pre-defined action. @@ -16519,6 +16659,7 @@ + Return whether the given action is being pressed. Not relevant for MOUSE_MOTION events, always false. @@ -16527,18 +16668,21 @@ + 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 [method is_action] is true. + Return if this input event is an echo event (only for events of type KEY, i.e. always false for this type). + Return if this input event is pressed. Not relevant for MOUSE_MOTION events, always false. @@ -16547,76 +16691,108 @@ + Change the input event to an action event of the given name with the (irrelevant for this type) pressed status passed as argument. + Event identifier, positive integer increased at each new event. + State of the Alt modifier. + Mouse button mask identifier, one of or a bitwise combination of the BUTTON_MASK_* constants in [@Global Scope]. + State of the Ctrl modifier. + Device identifier. + Global position of the mouse pointer. + Global X coordinate of the mouse pointer. + Global Y coordinate of the mouse pointer. + State of the Meta modifier. + Local position of the mouse pointer. + Position of the mouse pointer relative to the previous mouse position. + X coordinate of the mouse pointer relative to the previous mouse position. + Y coordinate of the mouse pointer relative to the previous mouse position. + State of the Shift modifier. + Speed of the mouse pointer. + Speed of the mouse pointer on the X axis. + Speed of the mouse pointer on the Y axis. + Type of event (one of the [InputEvent] constants). + Local X coordinate of the mouse pointer. + Local Y coordinate of the mouse pointer. + Empty input event. + Key event. + Mouse motion event. + Mouse button event. + Joystick motion event. + Joystick button event. + Screen touch event. + Screen drag event. + Pre-defined action event (see [InputMap]). + Built-in input event type for screen drag events. + Input event type for screen drag events that extends the global [InputEvent] type. @@ -16625,6 +16801,7 @@ + Return if this input event matches a pre-defined action. @@ -16633,6 +16810,7 @@ + Return whether the given action is being pressed. Not relevant for SCREEN_DRAG events, always false. @@ -16641,18 +16819,21 @@ + Return whether the given action is released (i.e. not pressed). Not relevant for SCREEN_DRAG events, can be true or false depending on whether [method is_action] is true. + Return if this input event is an echo event (only for events of type KEY, i.e. always false for this type). + Return if this input event is pressed. Not relevant for SCREEN_DRAG events, always false. @@ -16661,62 +16842,87 @@ + Change the input event to an action event of the given name with the (irrelevant for this type) pressed status passed as argument. + Event identifier, positive integer increased at each new event. + Device identifier. + Drag event index in the case of a multi-drag event. + Position of the drag event. + Position of the drag event relative to its start position. + X coordinate of the drag event relative to its start position. + Y coordinate of the drag event relative to its start position. + Speed of the drag event. + Speed of the drag event on the X axis. + Speed of the drag event on the Y axis. + Type of event (one of the [InputEvent] constants). + X coordinate of the drag event. + Y coordinate of the drag event. + Empty input event. + Key event. + Mouse motion event. + Mouse button event. + Joystick motion event. + Joystick button event. + Screen touch event. + Screen drag event. + Pre-defined action event (see [InputMap]). + Built-in input event type for touchscreen drag events. + Input event type for touchscreen drag events that extends the global [InputEvent] type. @@ -16725,6 +16931,7 @@ + Return if this input event matches a pre-defined action. @@ -16733,6 +16940,7 @@ + Return whether the given action is being pressed. @@ -16741,18 +16949,21 @@ + Return whether the given action is released (i.e. not pressed). + Return if this input event is an echo event (only for events of type KEY, i.e. always false for this type). + Return if this input event is pressed. @@ -16761,45 +16972,63 @@ + Change the input event to an action event of the given name with the pressed status passed as argument. + Event identifier, positive integer increased at each new event. + Device identifier. + Touch event index in the case of a multi-touch event. + Position of the touch event. + Pressed state of the touch event. + Type of event (one of the [InputEvent] constants). + X coordinate of the touch event. + Y coordinate of the touch event. + Empty input event. + Key event. + Mouse motion event. + Mouse button event. + Joystick motion event. + Joystick button event. + Screen touch event. + Screen drag event. + Pre-defined action event (see [InputMap]). @@ -16817,7 +17046,7 @@ - Add an [InputEvent] to action. This [InputEvent] will trigger the action. + Add an [InputEvent] to an action. This [InputEvent] will trigger the action. @@ -16844,7 +17073,7 @@ - Add an action to the [InputMap]. + Add an (empty) action to the [InputMap]. An [InputEvent] can then be added to this action with [method action_add_event]. @@ -16862,6 +17091,7 @@ + Return whether the given event is part of an existing action. @@ -16870,7 +17100,7 @@ - Return the action from an id. + Return the action corresponding to the identifier. @@ -16879,7 +17109,7 @@ - Return the id of an action. + Return the identifier of the given action. @@ -16888,14 +17118,14 @@ - Return an [Array] of [InputEvent]s associated with an action. + Return an array of InputEvents associated with a given action. - Return an [Array] of all actions in the [InputMap]. + Return an array of all actions in the [InputMap]. @@ -16904,12 +17134,12 @@ - Whether this InputMap has an action with name "action". + Whether this InputMap has a registered action with the given name. - Clears the [InputMap] and loads it from [Globals]. + Clear the [InputMap] and load it anew from [Globals].