1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-07-22 17:18:39 +00:00

Expose analog joystick input to the Lua API (#14348)

This commit is contained in:
grorp 2024-10-01 17:21:42 +02:00 committed by GitHub
parent 6569fdd4d1
commit 22ef4c8be1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 127 additions and 83 deletions

View file

@ -8249,12 +8249,18 @@ child will follow movement and rotation of that bone.
bgcolor[], any non-style elements (eg: label) may result in weird behavior.
* Only affects formspecs shown after this is called.
* `get_formspec_prepend()`: returns a formspec string.
* `get_player_control()`: returns table with player pressed keys
* 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`.
* `get_player_control()`: returns table with player input
* The table contains the following boolean fields 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.
* The table also contains the fields `movement_x` and `movement_y`.
* They represent the movement of the player. Values are numbers in the
range [-1.0,+1.0].
* They take both keyboard and joystick input into account.
* You should prefer them over `up`, `down`, `left` and `right` to
support different input methods correctly.
* Returns an empty table `{}` if the object is not a player.
* `get_player_control_bits()`: returns integer with bit packed player pressed
keys.