summaryrefslogtreecommitdiff
path: root/doc/lua_api.txt
diff options
context:
space:
mode:
authorANAND <ClobberXD@protonmail.com>2020-06-05 18:36:35 +0530
committerceleron55 <celeron55@gmail.com>2020-08-15 12:19:20 +0300
commit291a6b70d674d9003f522b5875a60f7e2753e32b (patch)
treeeb4368dfc8d0055b53bd1160b5a8836726245ffb /doc/lua_api.txt
parentfff03931871b68e092e12bfce9056f760e8ec9dd (diff)
downloadminetest-291a6b70d674d9003f522b5875a60f7e2753e32b.tar.gz
minetest-291a6b70d674d9003f522b5875a60f7e2753e32b.tar.bz2
minetest-291a6b70d674d9003f522b5875a60f7e2753e32b.zip
Allow binding dig, place actions to keys; remove LMB/RMB hardcoding
Co-authored-by: Sam Caulfield <sam@samcaulfield.com>
Diffstat (limited to 'doc/lua_api.txt')
-rw-r--r--doc/lua_api.txt24
1 files changed, 16 insertions, 8 deletions
diff --git a/doc/lua_api.txt b/doc/lua_api.txt
index 6366a34c3..88d99fcd5 100644
--- a/doc/lua_api.txt
+++ b/doc/lua_api.txt
@@ -6163,15 +6163,23 @@ object you are working with still exists.
* Only affects formspecs shown after this is called.
* `get_formspec_prepend(formspec)`: returns a formspec string.
* `get_player_control()`: returns table with player pressed keys
- * The table consists of fields with boolean value representing the pressed
- keys, the fields are jump, right, left, LMB, RMB, sneak, aux1, down, up, zoom.
- * example: `{jump=false, right=true, left=false, LMB=false, RMB=false,
- sneak=true, aux1=false, down=false, up=false, zoom=false}`
- * The `zoom` field is available since 5.3
+ * The table consists of fields with the following boolean values
+ representing the pressed keys: `up`, `down`, `left`, `right`, `jump`,
+ `aux1`, `sneak`, `dig`, `place`, `LMB`, `RMB`, and `zoom`.
+ * The fields `LMB` and `RMB` are equal to `dig` and `place` respectively,
+ and exist only to preserve backwards compatibility.
* `get_player_control_bits()`: returns integer with bit packed player pressed
- keys.
- * bit nr/meaning: 0/up, 1/down, 2/left, 3/right, 4/jump, 5/aux1, 6/sneak,
- 7/LMB, 8/RMB, 9/zoom (zoom available since 5.3)
+ keys. Bits:
+ * 0 - up
+ * 1 - down
+ * 2 - left
+ * 3 - right
+ * 4 - jump
+ * 5 - aux1
+ * 6 - sneak
+ * 7 - dig
+ * 8 - place
+ * 9 - zoom
* `set_physics_override(override_table)`
* `override_table` is a table with the following fields:
* `speed`: multiplier to default walking speed value (default: `1`)