Skip to content

Utility library for control press/hold/release events.

License

Notifications You must be signed in to change notification settings

mt-mods/controls

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Controls [controls]

luacheck ContentDB

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)

About

Utility library for control press/hold/release events.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Languages

  • Lua 100.0%