#include <woopsikey.h>
Public Types | |
enum | KeyType { KEY_NONE = 0, KEY_ALPHA_NUMERIC_SYMBOL = 1, KEY_RETURN = 3, KEY_CONTROL = 4, KEY_SHIFT = 5, KEY_CAPS_LOCK = 6, KEY_BACKSPACE = 7, KEY_SPACE = 8 } |
enum | KeyMode { KEY_MODE_NORMAL = 0, KEY_MODE_SHIFT = 1, KEY_MODE_CONTROL = 2, KEY_MODE_SHIFT_CONTROL = 3, KEY_MODE_CAPS_LOCK = 4, KEY_MODE_CONTROL_CAPS_LOCK = 5 } |
Public Member Functions | |
WoopsiKey (s16 x, s16 y, u16 width, u16 height, const char *text, const KeyType keyType=KEY_ALPHA_NUMERIC_SYMBOL, FontBase *font=NULL) | |
WoopsiKey (s16 x, s16 y, u16 width, u16 height, const char *normalText, const char *shiftText, const char *controlText, const char *shiftControlText, const char *capsLockText, const char *controlCapsLockText, const KeyType keyType=KEY_ALPHA_NUMERIC_SYMBOL, FontBase *font=NULL) | |
WoopsiKey (s16 x, s16 y, u16 width, u16 height, const char glyph, const KeyType keyType=KEY_ALPHA_NUMERIC_SYMBOL, FontBase *font=NULL) | |
const KeyType | getKeyType () const |
void | setKeyType (KeyType keyType) |
void | setKeyMode (KeyMode keyMode) |
const char | getValue () const |
Protected Member Functions | |
virtual | ~WoopsiKey () |
WoopsiKey (const WoopsiKey &key) | |
Protected Attributes | |
KeyType | _keyType |
char * | _normalText |
char * | _shiftText |
char * | _controlText |
char * | _shiftControlText |
char * | _capsLockText |
char * | _controlCapsLockText |
KeyMode | _keyMode |
Class providing a key for the WoopsiKeyboard class.
Enum listing all possible modes a key can be in. The modes reflect the keyboard state (ie. which modifiers are held down?), and each key has a separate string to display for each different mode. There is no mode for shift and caps lock nor for shift, caps lock and control, since in those situations the functionality of caps lock is already provided by the shift key.
Enum listing all possible types of key
WoopsiKey::WoopsiKey | ( | s16 | x, | |
s16 | y, | |||
u16 | width, | |||
u16 | height, | |||
const char * | text, | |||
const KeyType | keyType = KEY_ALPHA_NUMERIC_SYMBOL , |
|||
FontBase * | font = NULL | |||
) |
Constructor for keys for the keyboard that display a string. Same text is used regardless of which modifier keys are held down.
x | The x co-ordinate of the button, relative to its parent. | |
y | The y co-ordinate of the button, relative to its parent. | |
width | The width of the key. | |
height | The height of the key. | |
text | The text for the key to display. | |
keyType | The type of key. | |
font | The font that the button should use. |
WoopsiKey::WoopsiKey | ( | s16 | x, | |
s16 | y, | |||
u16 | width, | |||
u16 | height, | |||
const char * | normalText, | |||
const char * | shiftText, | |||
const char * | controlText, | |||
const char * | shiftControlText, | |||
const char * | capsLockText, | |||
const char * | controlCapsLockText, | |||
const KeyType | keyType = KEY_ALPHA_NUMERIC_SYMBOL , |
|||
FontBase * | font = NULL | |||
) |
Constructor for keys for the keyboard that display a string. Different string is supplied for each keyboard modifier situation.
x | The x co-ordinate of the button, relative to its parent. | |
y | The y co-ordinate of the button, relative to its parent. | |
width | The width of the key. | |
height | The height of the key. | |
normalText | The text for the key to display when no modifiers are held. | |
shiftText | The text for the key to display when shift is held. | |
controlText | The text for the key to display when control is held. | |
shiftControlText | The text for the key to display when shift and control are held. | |
capsLockText | The text for the key to display when caps lock is held. | |
controlCapsLockText | The text for the key to display when caps lock and control are held. | |
keyType | The type of key. | |
font | The font that the button should use. |
WoopsiKey::WoopsiKey | ( | s16 | x, | |
s16 | y, | |||
u16 | width, | |||
u16 | height, | |||
const char | glyph, | |||
const KeyType | keyType = KEY_ALPHA_NUMERIC_SYMBOL , |
|||
FontBase * | font = NULL | |||
) |
Constructor for keys for the keyboard that display a single char.
x | The x co-ordinate of the button, relative to its parent. | |
y | The y co-ordinate of the button, relative to its parent. | |
width | The width of the key. | |
height | The height of the key. | |
glyph | The letter for the key to display. | |
keyType | The type of key. | |
font | The font that the button should use. |
virtual WoopsiUI::WoopsiKey::~WoopsiKey | ( | ) | [inline, protected, virtual] |
Destructor.
WoopsiUI::WoopsiKey::WoopsiKey | ( | const WoopsiKey & | key | ) | [inline, protected] |
Copy constructor is protected to prevent usage.
const KeyType WoopsiUI::WoopsiKey::getKeyType | ( | ) | const [inline] |
Return the type of key this object represents.
const char WoopsiKey::getValue | ( | ) | const |
Get the value represented by this key. This is the text that should (for example) be printed to the screen when the key is clicked. Modifier keys return the string terminator character.
void WoopsiKey::setKeyMode | ( | KeyMode | keyMode | ) |
Set the mode of the key. Should only be called by the keyboard itself.
keyMode | The new mode for this key. |
void WoopsiUI::WoopsiKey::setKeyType | ( | KeyType | keyType | ) | [inline] |
Set the type of this key.
keyType | The new keytype for this key. |
char* WoopsiUI::WoopsiKey::_capsLockText [protected] |
Text displayed when in caps lock mode
char* WoopsiUI::WoopsiKey::_controlCapsLockText [protected] |
Text displayed when in control/caps lock mode
char* WoopsiUI::WoopsiKey::_controlText [protected] |
Text displayed when in control mode
KeyMode WoopsiUI::WoopsiKey::_keyMode [protected] |
Current mode
KeyType WoopsiUI::WoopsiKey::_keyType [protected] |
Type of key represented by this object
char* WoopsiUI::WoopsiKey::_normalText [protected] |
Text displayed when in normal mode
char* WoopsiUI::WoopsiKey::_shiftControlText [protected] |
Text displayed when in shift/control mode
char* WoopsiUI::WoopsiKey::_shiftText [protected] |
Text displayed when in shift mode