Controls

Utility library for control press/hold/release events

API / Library

controls library for minetest

Overview

Utility library for control press/hold/release events

API

Supported controls

callbacks

controls.register_on_press(function(player, control_name)
    -- called on initial key-press
    -- control_name: see above
end)

controls.register_on_release(function(player, control_name, time)
    -- called on key-release
    -- control_name: see above
    -- time: seconds the key was pressed
end)

controls.register_on_hold(function(player, control_name, time)
    -- called every globalstep if the key is pressed
    -- control_name: see above
    -- time: seconds the key was pressed
end)

Ratings and Reviews

Review

Do you recommend this mod?

Related