Controls Library

Adds callbacks when a player press, hold or release a button.

API / Library / Programmer Tools

Syntax:

controls.register_on_press(function(player, key))

Description:
Register a callback to be called when a player press a key or mousebutton.

Example:

    controls.register_on_press(function(player, key)
        minetest.chat_send_all(player:get_player_name().." pressed the key "..key.."!")
    end)