class_inputmap.rst 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  2. .. DO NOT EDIT THIS FILE, but the doc/base/classes.xml source instead.
  3. .. _class_InputMap:
  4. InputMap
  5. ========
  6. **Inherits:** :ref:`Object<class_object>`
  7. **Category:** Core
  8. Brief Description
  9. -----------------
  10. Singleton that manages actions.
  11. Member Functions
  12. ----------------
  13. +----------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
  14. | void | :ref:`action_add_event<class_InputMap_action_add_event>` **(** :ref:`String<class_string>` action, :ref:`Object<class_object>` event **)** |
  15. +----------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
  16. | void | :ref:`action_erase_event<class_InputMap_action_erase_event>` **(** :ref:`String<class_string>` action, :ref:`Object<class_object>` event **)** |
  17. +----------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
  18. | :ref:`bool<class_bool>` | :ref:`action_has_event<class_InputMap_action_has_event>` **(** :ref:`String<class_string>` action, :ref:`Object<class_object>` event **)** |
  19. +----------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
  20. | void | :ref:`add_action<class_InputMap_add_action>` **(** :ref:`String<class_string>` action **)** |
  21. +----------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
  22. | void | :ref:`erase_action<class_InputMap_erase_action>` **(** :ref:`String<class_string>` action **)** |
  23. +----------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
  24. | :ref:`bool<class_bool>` | :ref:`event_is_action<class_InputMap_event_is_action>` **(** :ref:`Object<class_object>` event, :ref:`String<class_string>` action **)** const |
  25. +----------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
  26. | :ref:`Array<class_array>` | :ref:`get_action_list<class_InputMap_get_action_list>` **(** :ref:`String<class_string>` action **)** |
  27. +----------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
  28. | :ref:`Array<class_array>` | :ref:`get_actions<class_InputMap_get_actions>` **(** **)** |
  29. +----------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
  30. | :ref:`bool<class_bool>` | :ref:`has_action<class_InputMap_has_action>` **(** :ref:`String<class_string>` action **)** const |
  31. +----------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
  32. | void | :ref:`load_from_globals<class_InputMap_load_from_globals>` **(** **)** |
  33. +----------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
  34. Member Function Description
  35. ---------------------------
  36. .. _class_InputMap_action_add_event:
  37. - void **action_add_event** **(** :ref:`String<class_string>` action, :ref:`Object<class_object>` event **)**
  38. Add an :ref:`InputEvent<class_inputevent>` to an action. This :ref:`InputEvent<class_inputevent>` will trigger the action.
  39. .. _class_InputMap_action_erase_event:
  40. - void **action_erase_event** **(** :ref:`String<class_string>` action, :ref:`Object<class_object>` event **)**
  41. Remove an :ref:`InputEvent<class_inputevent>` from an action.
  42. .. _class_InputMap_action_has_event:
  43. - :ref:`bool<class_bool>` **action_has_event** **(** :ref:`String<class_string>` action, :ref:`Object<class_object>` event **)**
  44. Whether an action has an :ref:`InputEvent<class_inputevent>` associated with it.
  45. .. _class_InputMap_add_action:
  46. - void **add_action** **(** :ref:`String<class_string>` action **)**
  47. Add an (empty) action to the :ref:`InputMap<class_inputmap>`. An :ref:`InputEvent<class_inputevent>` can then be added to this action with :ref:`action_add_event<class_InputMap_action_add_event>`.
  48. .. _class_InputMap_erase_action:
  49. - void **erase_action** **(** :ref:`String<class_string>` action **)**
  50. Remove an action from the :ref:`InputMap<class_inputmap>`.
  51. .. _class_InputMap_event_is_action:
  52. - :ref:`bool<class_bool>` **event_is_action** **(** :ref:`Object<class_object>` event, :ref:`String<class_string>` action **)** const
  53. Return whether the given event is part of an existing action. This method ignores keyboard modifiers if the given :ref:`InputEvent<class_inputevent>` is not pressed (for proper release detection). See :ref:`action_has_event<class_InputMap_action_has_event>` if you don't want this behavior.
  54. .. _class_InputMap_get_action_list:
  55. - :ref:`Array<class_array>` **get_action_list** **(** :ref:`String<class_string>` action **)**
  56. Return an array of InputEvents associated with a given action.
  57. .. _class_InputMap_get_actions:
  58. - :ref:`Array<class_array>` **get_actions** **(** **)**
  59. Return an array of all actions in the :ref:`InputMap<class_inputmap>`.
  60. .. _class_InputMap_has_action:
  61. - :ref:`bool<class_bool>` **has_action** **(** :ref:`String<class_string>` action **)** const
  62. Whether this InputMap has a registered action with the given name.
  63. .. _class_InputMap_load_from_globals:
  64. - void **load_from_globals** **(** **)**
  65. Clear the :ref:`InputMap<class_inputmap>` and load it anew from :ref:`Globals<class_globals>`.