Archon::Utilities::KeyboardEvents::Dispatcher Struct Reference

Mode shifts:. More...

#include <archon/util/keyboard.H>

Inheritance diagram for Archon::Utilities::KeyboardEvents::Dispatcher:

Inheritance graph
[legend]
Collaboration diagram for Archon::Utilities::KeyboardEvents::Dispatcher:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Dispatcher (unsigned numberOfModes=1, unsigned maxMultipressLimit=1, unsigned long multipressMaxDelay=200)
 'multipressMaxDelay' is mesured in milliseconds and is the maximum delay between two successive presses on the same key for the second press to belong to the same multipress sequence as the first press.
virtual ~Dispatcher ()
void setMultipressLimit (Key, unsigned limit)
 'limit' must not be greater than 'maxMultipressLimit'
void setHandler (Key, Handler *, unsigned mode=0, unsigned multipressCardinality=1)
void setMode (unsigned)
unsigned getMode () const

Classes

struct  KeyAccount

Detailed Description

Mode shifts:.

To deal with the need for changing the meaning of keys according to the mode or context of the application, you may initially configure a set of modes. Then at any time you may change the mode of the dispacher, efectively substituting the meanings of all the keys with new ones. This is similar in spirit to the well known idea of changing the case of the letters by pressing the shift button.

Multiple presses on a key:

The phrase 'multipress' is in this context used to describe a sequence of rapid presses on the same key. That is, you may assign a special handler for the event of eg. a double press on the spacebar. This resembles the proberbly more familiar idea of double clicks on a mouse button.

Note however, that you cannot completely discriminate between single and bouble presses on some key. You will always get the single-press-handler called upon the first press. Then if a second press is encountered within the maximum allowed period your double-press-handler will be called.

Definition at line 165 of file keyboard.H.


The documentation for this struct was generated from the following files:
Generated on Sun Jul 30 22:58:08 2006 for Archon by  doxygen 1.4.4