#include <lua/sidekick-pins.lh>
#include <lua/scancode.lh>
- kbdhandle:setButton(button, pin, scancode)
- kbdhandle:setButton(button)
The V4 Controller has support for up to sixteen pusbuttons that are directly connected to an input pin.
The button parameter numbers the button from 0 ··· 15. This number is reported within input events on the keyboard handle.
The value of pin indicates the pin number of the button. When missing, the button is disabled.
The value of scancode will be reported in the key press event when the button is pressed. To assign a generic scancode, use SCANCODE(KEY_xxx), using one of the scancode definitions from lua/scancode.lh
The second form of the command, with no further parameters, disables the specified button.
An example use is a rotary encoder on inputs 0 and 1 with the button on input 2.