computercraft.keyboard
– ComputerCraft keyboard#
This device is an abstract device provided by thumb, which makes the key and keyup events accessible.
Available methods#
This device does not make methods available.
Events#
Note
The original key event has a third argument representing whether the event was raised while holding the key or pressing it for the first time, i.e. repeating key support. This abstraction eliminates this by filtering repeat events out and disabling support for this feature, in favour of managing it internally.
- class computercraft.keyboard.KeyDownEvent: DeviceEvent#
Event raised when a key is pressed on the keyboard.
- type: string#
Set to
"key_down"
.
- code: number#
Numeric value of the pressed key.
- class computercraft.keyboard.KeyUpEvent: DeviceEvent#
Event raised when a key is released on the keyboard.
- type: string#
Set to
"key_up"
.
- code: number#
Numeric value of the released key.