Input Documentation

Input Documentation

(cherry picked from commit f6ae5e41de)
This commit is contained in:
CowThing 2016-05-03 14:42:41 -04:00 committed by Rémi Verschelde
parent b3404c8c44
commit f95918e05a
1 changed files with 16 additions and 0 deletions

View File

@ -14035,8 +14035,10 @@ Example: (content-length:12), (Content-Type:application/json; charset=UTF-8)
</class>
<class name="Input" inherits="Object" category="Core">
<brief_description>
A Singleton that deals with inputs.
</brief_description>
<description>
A Singleton that deals with inputs. This includes key presses, mouse buttons and movement, joysticks, and input actions.
</description>
<methods>
<method name="is_key_pressed">
@ -14045,6 +14047,7 @@ Example: (content-length:12), (Content-Type:application/json; charset=UTF-8)
<argument index="0" name="scancode" type="int">
</argument>
<description>
Returns true or false depending on whether the key is pressed or not. You can pass KEY_*, which are pre-defined constants listed in [@Global Scope].
</description>
</method>
<method name="is_mouse_button_pressed">
@ -14073,6 +14076,7 @@ Example: (content-length:12), (Content-Type:application/json; charset=UTF-8)
<argument index="0" name="action" type="String">
</argument>
<description>
Returns true or false depending on whether the action event is pressed. Actions and their events can be set in the Project Settings / Input Map tab. Or be set with [InputMap].
</description>
</method>
<method name="add_joy_mapping">
@ -14133,48 +14137,56 @@ Example: (content-length:12), (Content-Type:application/json; charset=UTF-8)
<return type="Vector3">
</return>
<description>
If the device has an accelerometer, this will return the movement.
</description>
</method>
<method name="get_mouse_speed" qualifiers="const">
<return type="Vector2">
</return>
<description>
Returns the mouse speed.
</description>
</method>
<method name="get_mouse_button_mask" qualifiers="const">
<return type="int">
</return>
<description>
Returns mouse buttons as a bitmask. If multiple mouse buttons are pressed at the same time the bits are added together.
</description>
</method>
<method name="set_mouse_mode">
<argument index="0" name="mode" type="int">
</argument>
<description>
Set the mouse mode. See the constants for more information.
</description>
</method>
<method name="get_mouse_mode" qualifiers="const">
<return type="int">
</return>
<description>
Return the mouse mode. See the constants for more information.
</description>
</method>
<method name="warp_mouse_pos">
<argument index="0" name="to" type="Vector2">
</argument>
<description>
Sets the mouse position to the specified vector.
</description>
</method>
<method name="action_press">
<argument index="0" name="action" type="String">
</argument>
<description>
This will simulate pressing the specificed action.
</description>
</method>
<method name="action_release">
<argument index="0" name="action" type="String">
</argument>
<description>
If the specified action is already pressed, this will release it.
</description>
</method>
<method name="set_custom_mouse_cursor">
@ -14183,6 +14195,7 @@ Example: (content-length:12), (Content-Type:application/json; charset=UTF-8)
<argument index="1" name="hotspot" type="Vector2" default="Vector2(0,0)">
</argument>
<description>
Set a custom mouse cursor image, which is only visible inside the game window. The hotspot can also be specified.
</description>
</method>
</methods>
@ -14199,10 +14212,13 @@ Example: (content-length:12), (Content-Type:application/json; charset=UTF-8)
</signals>
<constants>
<constant name="MOUSE_MODE_VISIBLE" value="0">
Makes the mouse cursor visible if it is hidden.
</constant>
<constant name="MOUSE_MODE_HIDDEN" value="1">
Makes the mouse cursor hidden if it is visible.
</constant>
<constant name="MOUSE_MODE_CAPTURED" value="2">
Captures the mouse. The mouse will be hidden and unable to leave the game window. But it will still register movement and mouse button presses.
</constant>
</constants>
</class>