controls/readme.md
2023-12-03 16:36:15 -05:00

25 lines
596 B
Markdown

# api
note: supports all keys minetest does
```lua
controls.register_on_press(function(player, key)
-- called on key down
-- @player: player object
-- @key: key pressed
end)
controls.register_on_hold(function(player, key, length)
-- called while key is held
-- @player: player object
-- @key: key pressed
-- @length: length of time key was held in seconds
end)
controls.register_on_release(function(player, key, length)
-- called on key up
-- @player: player object
-- @key: key pressed
-- @length: length of time key was held in seconds
end)
```