Controls

Download (3 KB)
For Luanti 5.0 and above

How do I install this?

Description

Utility library for control press/hold/release events.

Rewritten and maintained version of Arcelmi/minetest-controls.

API 🔗

Callbacks are supported for all keys in player:get_player_control().

controls.register_on_press(function(player, key)
    -- Called when a key is pressed
    -- player: player object
    -- key: key pressed
end)

controls.register_on_hold(function(player, key, length)
    -- Called every globalstep while a key is held
    -- player: player object
    -- key: key pressed
    -- length: length of time key has been held in seconds
end)

controls.register_on_release(function(player, key, length)
    -- Called when a key is released
    -- player: player object
    -- key: key pressed
    -- length: length of time key was held in seconds
end)

Reviews

Review

Do you recommend this mod?

  • No reviews, yet.

Releases

2025-02-26

Download

Luanti 5.0+

2025-02-26 02:11 UTC

2025-02-26 🔗

  • Fix crash with newer Luanti versions adding new controls (#8)

2024-02-09

Download

Luanti 5.0+

2024-02-09 02:11 UTC

2024-02-09 🔗

No release notes

2023-12-06

Download

Luanti 5.0+

2023-12-06 12:55 UTC

2023-12-06 🔗

No release notes

2020-12-16

Download

Luanti 5.0+

2020-12-16 15:32 UTC

2020-12-16 🔗

No release notes

All releases

Information

Provides

controls

Dependencies

Required
No required dependencies

Information

Type
Mod
Technical Name
controls
Languages
English
License
MIT
Maintenance State
Maintenance Only
Added
2020-12-16 15:30 UTC
Maintainers
mt-mods

Used By