trikRuntime
trikControl::KeysInterface Class Referenceabstract

Class for handling keys on a brick. More...

#include <keysInterface.h>

Inheritance diagram for trikControl::KeysInterface:
Collaboration diagram for trikControl::KeysInterface:

Public Slots

virtual void reset ()=0
 Clear data about previous key pressures. More...
 
virtual bool wasPressed (int code)=0
 Returns true if button with given code was pressed, and clears "pressed" state for that button. More...
 
virtual bool isPressed (int code)=0
 Returns true if button with given code is pressed at the moment. More...
 
virtual int buttonCode (bool wait=true)=0
 Returns a code of a pressed button. More...
 

Signals

void buttonPressed (int code, int value)
 Triggered when button state changed (pressed or released). More...
 

Additional Inherited Members

- Public Types inherited from trikControl::DeviceInterface
enum  Status {
  Status::permanentFailure, Status::temporaryFailure, Status::off, Status::starting,
  Status::ready, Status::stopping
}
 Device status. More...
 
- Public Member Functions inherited from trikControl::DeviceInterface
 DeviceInterface ()=default
 
virtual ~DeviceInterface ()=default
 
virtual Status status () const =0
 Returns current status of the device. More...
 
- Static Public Member Functions inherited from trikControl::DeviceInterface
static Status combine (const DeviceInterface &underlying, const DeviceInterface::Status &dependent)
 Helper method to return status of a device relying on other device to work. More...
 

Detailed Description

Class for handling keys on a brick.

Member Function Documentation

virtual int trikControl::KeysInterface::buttonCode ( bool  wait = true)
pure virtualslot

Returns a code of a pressed button.

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

Triggered when button state changed (pressed or released).

Parameters
code- key code.
value- key state.
virtual bool trikControl::KeysInterface::isPressed ( int  code)
pure virtualslot

Returns true if button with given code is pressed at the moment.

virtual void trikControl::KeysInterface::reset ( )
pure virtualslot

Clear data about previous key pressures.

virtual bool trikControl::KeysInterface::wasPressed ( int  code)
pure virtualslot

Returns true if button with given code was pressed, and clears "pressed" state for that button.


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