Controls Library

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

API / Library

State: Work in Progress
You should add at least one screenshot, but this isn't required.
This package can be submitted for approval when ready.

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)

Ratings and Reviews

Review

Do you recommend this mod?

Related