Adds button press, hold and release events.
Go to file
2020-12-16 16:28:40 +01:00
.github/workflows add luacheck action 2020-12-16 16:19:06 +01:00
.gitignore Initial commit 2017-09-14 14:34:32 +02:00
.luacheckrc add luacheck 2020-04-28 08:05:06 +02:00
init.lua dig + place key 2020-10-14 22:16:37 +02:00
LICENSE Update LICENSE 2017-12-12 17:43:41 +01:00
mod.conf Add files via upload 2017-09-14 14:35:13 +02:00
readme.md update readme 2020-12-16 16:28:40 +01:00

controls library for minetest

Overview

Utility library for control press/hold/release events

API

Supported controls

  • jump
  • right
  • left
  • LMB
  • RMB
  • sneak
  • aux1
  • down
  • up
  • zoom
  • dig
  • place

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)

References

used by https://github.com/Arcelmi/minetest-bows.git Original repo: https://github.com/Arcelmi/minetest-controls

License

LGPL 2.1 (see LICENSE file)