- Inherits from:
- Object
- Conforms to:
- DParsable, DTextable
- Declared in:
- DKey.h
Object
|
+---DKey
Class Description
The DKey class implements methods for storing keyboard keys.
- Last modified:
- 21-Nov-2005 (DKey.h)
Instance Variables
- private int _code
- the keyboard code
- Constructors
- - (DKey *) init
- Initialise an empty key
- Returns:
- the object
- - (DKey *) init :(int) code
- Initialise a key
- Parameters:
- code - the key code
- Returns:
- the object
- Copy related methods
- - deepen
- Deepen a copy of the key
- Returns:
- the object
- Destructor
- - free
- Free the key
- Returns:
- the object
- Member methods
- - (BOOL) isAltKey
- Check if the key is an alt key
- Returns:
- is it ?
- - (BOOL) isCtrlKey
- Check if the key is a control key. Note Ctrl-@ till Ctrl-_ are *NOT*
control keys.
- Returns:
- is it ?
- - (BOOL) isFunctionKey
- Check if the key is a function key
- Returns:
- is it ?
- - (BOOL) isKeypadKey
- Check if the key is a keypad key
- Returns:
- is it ?
- - (BOOL) isMouseKey
- Check if the key is a mouse key
- Returns:
- is it ?
- - (BOOL) isShiftKey
- Check if the key is a shifted key
- Returns:
- is it ?
- Main methods
- - (int) get
- Get the key code (incl. modifiers) from the object
- Returns:
- the key code
- - (int) key
- Get the key (without the modifiers)
- Returns:
- the key
- - (int) mod
- Get the modifiers (without the key, no mouse modifier)
- Returns:
- the modifiers
- - (DKey *) set :(int) code
- Set the key in the object. (the code is not checked for unknown keys,
so 'other' keys can also be stored in the object)
- Parameters:
- code - the key code
- Returns:
- the object
- Textable protocol implementation
- - (DText *) toText
- Convert the key to a text string
- Returns:
- a (new) text string with the key
- Parsable protocol implementation
- - (int) fromString :(char **) cstr
- Parse a string to set a key object.
Example: ctrl-alt-delete, shift-f1, ctrl-I, #
- Parameters:
- cstr - the string to be parsed (moved to first non-parsable char)
- Returns:
- the result (0, ERANGE, ENODATA)
generated 08-Jan-2006 by ObjcDoc 3.0.0