Main Page | Modules | Class Hierarchy | Data Structures | File List | Data Fields | Globals | Related Pages

omKeyboardDriver Class Reference
[DEVICE DRIVER classes of the OpenMAIA Library]

#include <omKeyboardDriver.h>

Inheritance diagram for omKeyboardDriver:

omObject

Public Member Functions

 omKeyboardDriver (omObject *, omObject *, int, long, long, long, long, long, bool, bool)
 ~omKeyboardDriver ()
void SetOnPress (bool)
void SetGrabKeys (bool)
void Start ()
void Stop ()
void GrabActionKeys ()
void UngrabActionKeys ()
 This function is used to ungrab the control of the action keys.

void FlushKeysState ()

Data Fields

omObjecttoInform
 Object to send event to.

omObjectexecutorController
 Object that controls the OpenMAIA executor class.


Private Member Functions

void Notify ()
 override the Notify method of the wxTimer parent

void SystemDependentConstructor ()
 System dependent part of constructor see in x11 or windows folder.

void SystemDependentNotify ()
 System dependent notify method.

void SDFlushKey (long, bool *)
 System dependent flush key method.

void SDGrabActionKeys ()
 System dependent GrabActionKey method.

void SDUngrabActionKeys ()
 System dependent UngrabActionKey method.

void SDFlushKeysState ()
 System dependent FlushKeysState method.

void SDDestructor ()
 System dependent Destructor.


Private Attributes

long actionKey
 OpenMAIA ACTION key code.

long upKey
 OpenMAIA UP key code.

long downKey
 OpenMAIA DOWN key code.,.

long leftKey
 OpenMAIA LEFT key code.

long rightKey
 OpenMAIA RIGHT key code.

bool grabKeys
 Flag.

bool actionOnPress
 Flag.

void * systemDependentData
long maiaKeyCode [MAXMAIACODES]
 Keycodes hash table.

int tickTime
 Timer period.


Detailed Description

OpenMAIA Keyboard Driver.

This class is a driver used to interface a standard keyboard with the OpenMAIA system.
Some keys of a standard keyboard can be used to generate events for OpenMAIA Applications.
This driver can handle the status of 5 keys and generate OpenMAIA events to an object according with these keys status.
The code of the keys used to generate events is passed via the constructor of the class according with OpenMAIA Key codes avaiable in the omemukeys.h header file.


Constructor & Destructor Documentation

omKeyboardDriver::omKeyboardDriver omObject object,
omObject ec,
int  tick,
long  action,
long  up,
long  down,
long  left,
long  right,
bool  onpress,
bool  grab
 

Initialize the class.

Parameters:
object object to inform if event occoured.
ec object that controls the executor (maybe null).
tick time between check tics in milliseconds.
action maia key code of the action key.
up maia key code of the up key.
down maia key code of the down key.
left maia key code of the left key.
right maia key code of the right key.
onpress true if action on press false if action on release.
grab true if keys must be grabbed by the application. (see SetGrabKeys)

omKeyboardDriver::~omKeyboardDriver  ) 
 

The destructor releases grabbed keys of the keyboard for further use


Member Function Documentation

void omKeyboardDriver::FlushKeysState  ) 
 

Flush the state of control keys.
This method is used to reset the state of the control keys.

void omKeyboardDriver::GrabActionKeys  ) 
 

This function is used to grab the control of all action keys. Avaiable only in windows.

void omKeyboardDriver::Notify  )  [private]
 

override the Notify method of the wxTimer parent

void omKeyboardDriver::SDDestructor  )  [private]
 

System dependent Destructor.

void omKeyboardDriver::SDFlushKey long  ,
bool * 
[private]
 

System dependent flush key method.

void omKeyboardDriver::SDFlushKeysState  )  [private]
 

System dependent FlushKeysState method.

void omKeyboardDriver::SDGrabActionKeys  )  [private]
 

System dependent GrabActionKey method.

void omKeyboardDriver::SDUngrabActionKeys  )  [private]
 

System dependent UngrabActionKey method.

void omKeyboardDriver::SetGrabKeys bool  grab  ) 
 

Set GrabKeys flag.
This class detects the state of the keys specified in the constructor.
When a key is pressed or released (according with the state of actionOnPress flag) an event is generated. If keys are not grabbed the pression even is propageted to the windows manager so the system can handle key event. If keys are grabbed by the OpenMAIA application the system is unable to handle key event so the key is useless by the system.

Parameters:
grab value of the flag.

void omKeyboardDriver::SetOnPress bool  op  ) 
 

Set OnPress flag

Parameters:
op value of the onpress flag

void omKeyboardDriver::Start  )  [virtual]
 

Start event pooling with the time interval specified in the constructor

Reimplemented from omObject.

void omKeyboardDriver::Stop  )  [virtual]
 

Start event pooling with the time interval specified in the constructor

Reimplemented from omObject.

void omKeyboardDriver::SystemDependentConstructor  )  [private]
 

System dependent part of constructor see in x11 or windows folder.

void omKeyboardDriver::SystemDependentNotify  )  [private]
 

System dependent notify method.

void omKeyboardDriver::UngrabActionKeys  ) 
 

This function is used to ungrab the control of the action keys.


Field Documentation

long omKeyboardDriver::actionKey [private]
 

OpenMAIA ACTION key code.

bool omKeyboardDriver::actionOnPress [private]
 

Flag.

long omKeyboardDriver::downKey [private]
 

OpenMAIA DOWN key code.,.

omObject* omKeyboardDriver::executorController
 

Object that controls the OpenMAIA executor class.

bool omKeyboardDriver::grabKeys [private]
 

Flag.

long omKeyboardDriver::leftKey [private]
 

OpenMAIA LEFT key code.

long omKeyboardDriver::maiaKeyCode[MAXMAIACODES] [private]
 

Keycodes hash table.

long omKeyboardDriver::rightKey [private]
 

OpenMAIA RIGHT key code.

void* omKeyboardDriver::systemDependentData [private]
 

System dependent data structure defined in x11 or windows folder.

int omKeyboardDriver::tickTime [private]
 

Timer period.

omObject* omKeyboardDriver::toInform
 

Object to send event to.

long omKeyboardDriver::upKey [private]
 

OpenMAIA UP key code.


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