From 5b51887b171802032c3abb17f30140eade073edc Mon Sep 17 00:00:00 2001 From: BuckarooBanzay Date: Wed, 16 Dec 2020 16:28:40 +0100 Subject: [PATCH] update readme --- readme.md | 49 ++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 48 insertions(+), 1 deletion(-) diff --git a/readme.md b/readme.md index becc01d..1c735f1 100644 --- a/readme.md +++ b/readme.md @@ -3,7 +3,54 @@ controls library for minetest ![](https://github.com/mt-mods/controls/workflows/luacheck/badge.svg) +# 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 + +```lua +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)