.. Generated automatically by doc/tools/makerst.py in Godot's source tree. .. DO NOT EDIT THIS FILE, but the doc/base/classes.xml source instead. .. _class_Input: Input ===== **Inherits:** :ref:`Object` **Inherited By:** :ref:`InputDefault` **Category:** Core Brief Description ----------------- Member Functions ---------------- +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_key_pressed` **(** :ref:`int` scancode **)** | +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_mouse_button_pressed` **(** :ref:`int` button **)** | +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_joy_button_pressed` **(** :ref:`int` device, :ref:`int` button **)** | +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_action_pressed` **(** :ref:`String` action **)** | +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`add_joy_mapping` **(** :ref:`String` mapping, :ref:`bool` update_existing=false **)** | +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`remove_joy_mapping` **(** :ref:`String` guid **)** | +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_joy_known` **(** :ref:`int` device **)** | +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`get_joy_axis` **(** :ref:`int` device, :ref:`int` axis **)** | +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`get_joy_name` **(** :ref:`int` device **)** | +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`get_joy_guid` **(** :ref:`int` device **)** const | +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector3` | :ref:`get_accelerometer` **(** **)** | +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector2` | :ref:`get_mouse_speed` **(** **)** const | +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_mouse_button_mask` **(** **)** const | +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_mouse_mode` **(** :ref:`int` mode **)** | +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_mouse_mode` **(** **)** const | +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`warp_mouse_pos` **(** :ref:`Vector2` to **)** | +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`action_press` **(** :ref:`String` action **)** | +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`action_release` **(** :ref:`String` action **)** | +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_custom_mouse_cursor` **(** :ref:`Texture` image, :ref:`Vector2` hotspot=Vector2(0,0) **)** | +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ Signals ------- - **joy_connection_changed** **(** :ref:`int` index, :ref:`bool` connected **)** Numeric Constants ----------------- - **MOUSE_MODE_VISIBLE** = **0** - **MOUSE_MODE_HIDDEN** = **1** - **MOUSE_MODE_CAPTURED** = **2** Member Function Description --------------------------- .. _class_Input_is_key_pressed: - :ref:`bool` **is_key_pressed** **(** :ref:`int` scancode **)** .. _class_Input_is_mouse_button_pressed: - :ref:`bool` **is_mouse_button_pressed** **(** :ref:`int` button **)** Returns true or false depending on whether mouse button is pressed or not. You can pass BUTTON\_\*, which are pre-defined constants listed in :ref:`@Global Scope`. .. _class_Input_is_joy_button_pressed: - :ref:`bool` **is_joy_button_pressed** **(** :ref:`int` device, :ref:`int` button **)** Returns if the joystick button at the given index is currently pressed. (see JOY\_\* constants in :ref:`@Global Scope`) .. _class_Input_is_action_pressed: - :ref:`bool` **is_action_pressed** **(** :ref:`String` action **)** .. _class_Input_add_joy_mapping: - void **add_joy_mapping** **(** :ref:`String` mapping, :ref:`bool` update_existing=false **)** Add a new mapping entry (in SDL2 format) to the mapping database. Optionally update already connected devices. .. _class_Input_remove_joy_mapping: - void **remove_joy_mapping** **(** :ref:`String` guid **)** Removes all mappings from the internal db that match the given uid. .. _class_Input_is_joy_known: - :ref:`bool` **is_joy_known** **(** :ref:`int` device **)** Returns if the specified device is known by the system. This means that it sets all button and axis indices exactly as defined in the JOY\_\* constants (see :ref:`@Global Scope`). Unknown joysticks are not expected to match these constants, but you can still retrieve events from them. .. _class_Input_get_joy_axis: - :ref:`float` **get_joy_axis** **(** :ref:`int` device, :ref:`int` axis **)** Returns the current value of the joystick axis at given index (see JOY\_\* constants in :ref:`@Global Scope`) .. _class_Input_get_joy_name: - :ref:`String` **get_joy_name** **(** :ref:`int` device **)** Returns the name of the joystick at the specified device index .. _class_Input_get_joy_guid: - :ref:`String` **get_joy_guid** **(** :ref:`int` device **)** const Returns a SDL2 compatible device guid on platforms that use gamepad remapping. Returns "Default Gamepad" otherwise. .. _class_Input_get_accelerometer: - :ref:`Vector3` **get_accelerometer** **(** **)** .. _class_Input_get_mouse_speed: - :ref:`Vector2` **get_mouse_speed** **(** **)** const .. _class_Input_get_mouse_button_mask: - :ref:`int` **get_mouse_button_mask** **(** **)** const .. _class_Input_set_mouse_mode: - void **set_mouse_mode** **(** :ref:`int` mode **)** .. _class_Input_get_mouse_mode: - :ref:`int` **get_mouse_mode** **(** **)** const .. _class_Input_warp_mouse_pos: - void **warp_mouse_pos** **(** :ref:`Vector2` to **)** .. _class_Input_action_press: - void **action_press** **(** :ref:`String` action **)** .. _class_Input_action_release: - void **action_release** **(** :ref:`String` action **)** .. _class_Input_set_custom_mouse_cursor: - void **set_custom_mouse_cursor** **(** :ref:`Texture` image, :ref:`Vector2` hotspot=Vector2(0,0) **)**