[(Client)Mod] Event on Key Press [keyevent]
Go to file
2019-05-31 13:33:02 +02:00
description.txt 💥 2017-06-02 17:15:49 +02:00
init.lua remove some unneeded stuff 2019-05-31 13:33:02 +02:00
license.txt add license 2017-06-02 17:34:48 +02:00
mod.conf 💥 2017-06-02 17:15:49 +02:00
README.md add filter 2017-06-03 12:05:32 +02:00

Adds an event for when player presses a key.

This mod is client- and server-side.

Added functions are:

  • keyevent.register_on_keypress_bits([keys_to_be_pressed, ]func(keys, old_keys, dtime, player_name))

    • keys_to_be_pressed: Optional. It can be a string, a table or a number. If any of these keys is changed, the event is triggered
    • keys: The pressed keys in bit format.
    • old_keys: The keys pressed before.
    • dtime: Time from last check.
    • player_name: Name of the player. Client-side this is nil.
  • keyevent.register_on_keypress([keys_to_be_pressed, ]func(keys, old_keys, dtime, player_name))

    • Same as above but keys and old_keys is given in table format.