mirror of
https://github.com/Insality/druid
synced 2025-06-27 02:17:52 +02:00
2.1 KiB
2.1 KiB
druid.hotkey API
at /druid/extended/hotkey.lua
Functions
Fields
init
hotkey:init(keys, callback, [callback_argument])
The Hotkey constructor
- Parameters:
keys
(string|string[]): The keys to be pressed for trigger callback. Should contains one key and any modificator keyscallback
(function): The callback function[callback_argument]
(any): The argument to pass into the callback function
on_style_change
hotkey:on_style_change(style)
- Parameters:
style
(druid.hotkey.style):
add_hotkey
hotkey:add_hotkey(keys, [callback_argument])
Add hotkey for component callback
-
Parameters:
keys
(string|hash|hash[]|string[]): that have to be pressed before key pressed to activate[callback_argument]
(any): The argument to pass into the callback function
-
Returns:
Current
(druid.hotkey): instance
is_processing
hotkey:is_processing()
- Returns:
- `` (boolean):
on_focus_gained
hotkey:on_focus_gained()
on_input
hotkey:on_input([action_id], action)
-
Parameters:
[action_id]
(hash|nil):action
(action):
-
Returns:
- `` (boolean):
set_repeat
hotkey:set_repeat(is_enabled_repeated)
If true, the callback will be triggered on action.repeated
-
Parameters:
is_enabled_repeated
(bool): The flag value
-
Returns:
- `` (druid.hotkey):
Fields
- on_hotkey_pressed (event)
- on_hotkey_released (event)
- style (druid.hotkey.style)
- druid (druid.instance)