trikRuntime
|
Watches for keys on a brick, intended to work in separate thread. More...
#include <keysWorker.h>
Public Slots | |
bool | wasPressed (int code) |
Returns true if a key with given code was pressed. More... | |
Signals | |
void | buttonPressed (int code, int value) |
Triggered when button state changed (pressed or released). More... | |
Public Member Functions | |
KeysWorker (const QString &keysPath, DeviceState &state, const trikHal::HardwareAbstractionInterface &hardwareAbstraction) | |
Constructor. More... | |
void | reset () |
Clear data about previous key pressures. More... | |
Watches for keys on a brick, intended to work in separate thread.
KeysWorker::KeysWorker | ( | const QString & | keysPath, |
DeviceState & | state, | ||
const trikHal::HardwareAbstractionInterface & | hardwareAbstraction | ||
) |
Constructor.
keysPath | - path to device file that controls brick keys. |
state | - device state, worker sets it to "failed" if it can not open file. |
hardwareAbstraction | - interface to TRIK hardware. |
|
signal |
Triggered when button state changed (pressed or released).
code | - key code. |
value | - key state. |
void KeysWorker::reset | ( | ) |
Clear data about previous key pressures.
|
slot |
Returns true if a key with given code was pressed.