trikRuntime
trikControl::KeysWorker Class Reference

Watches for keys on a brick, intended to work in separate thread. More...

#include <keysWorker.h>

Inheritance diagram for trikControl::KeysWorker:
Collaboration diagram for trikControl::KeysWorker:

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...
 

Detailed Description

Watches for keys on a brick, intended to work in separate thread.

Constructor & Destructor Documentation

KeysWorker::KeysWorker ( const QString &  keysPath,
DeviceState state,
const trikHal::HardwareAbstractionInterface hardwareAbstraction 
)

Constructor.

Parameters
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.

Member Function Documentation

void trikControl::KeysWorker::buttonPressed ( int  code,
int  value 
)
signal

Triggered when button state changed (pressed or released).

Parameters
code- key code.
value- key state.
void KeysWorker::reset ( )

Clear data about previous key pressures.

bool KeysWorker::wasPressed ( int  code)
slot

Returns true if a key with given code was pressed.


The documentation for this class was generated from the following files: