2017-06-02 17:20:39 +02:00
|
|
|
## Adds an event for when player presses a key.
|
2017-06-02 17:15:49 +02:00
|
|
|
|
2017-06-02 17:20:39 +02:00
|
|
|
### This mod is client- and server-side.
|
2017-06-02 17:15:49 +02:00
|
|
|
|
2017-06-02 17:20:39 +02:00
|
|
|
### Added functions are:
|
2017-06-03 09:12:39 +02:00
|
|
|
- `keyevent.register_on_keypress_bits(func(keys, old_keys, dtime, player_name))`
|
2017-06-02 17:20:39 +02:00
|
|
|
- `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`.
|
2017-06-02 17:15:49 +02:00
|
|
|
|
2017-06-03 09:12:39 +02:00
|
|
|
- `keyevent.register_on_keypress(func(keys, old_keys, dtime, player_name))`
|
2017-06-02 17:20:39 +02:00
|
|
|
- Same as above but `keys` and `old_keys` is given in table format.
|
2017-06-02 17:15:49 +02:00
|
|
|
|