csInputDefinition Class Reference
This class holds a description of a physical source of input events, such as a keyboard key, mouse or joystick button, or a mouse or joystick axis. More...
#include <csutil/inputdef.h>
Public Member Functions | |
| int | Compare (csInputDefinition const &) const |
| Returns a number indicating the relation of the two definitions. | |
| uint32 | ComputeHash () const |
| Generate a hash value from the object. | |
| csInputDefinition (iEventNameRegistry *name_reg, const char *string, uint32 honorModifiers=0, bool useCookedCode=false) | |
| Construct an input description from a string. | |
| csInputDefinition (iEventNameRegistry *name_reg, iEvent *event, uint8 axis) | |
| Construct an input description from an iEvent (usually an axis). | |
| csInputDefinition (iEventNameRegistry *name_reg, iEvent *event, uint32 honorModifiers=0, bool useCookedCode=false) | |
| Construct an input description from an iEvent (usually a button). | |
| csInputDefinition (const csInputDefinition &other) | |
| Copy constructor. | |
| csInputDefinition (iEventNameRegistry *name_reg, uint32 honorModifiers=0, bool useCookedCode=false) | |
| Default constructor. | |
| const uint | GetDeviceNumber () const |
| Returns the (basis-0) device number of the description. | |
| bool | GetKeyCode (utf32_char &code, bool &isCooked) const |
| Gives the key code of the description, assuming it is a keyboard type. | |
| const csKeyModifiers & | GetModifiers () const |
| Returns the keyboard modifiers of the description. | |
| csEventID | GetName () const |
| Returns the event name of the description (a csev... constant). | |
| int | GetNumber () const |
| Returns the numeric value of the description. | |
| bool | IsValid () const |
| Returns a boolean indicating whether the object contains a valid input. | |
| bool | SetKeyCode (utf32_char code) |
| Sets the key code of the description, assuming it is a keyboard type. | |
| void | SetModifiers (const csKeyModifiers &mods) |
| Sets the keyboard modifiers of the description. | |
| void | SetName (csEventID n) |
| Set the event type of the description (a csev... constant). | |
| void | SetNumber (int n) |
| Sets the numeric value of the description. | |
| csString | ToString (bool distinguishModifiers=true) const |
| Gets the string representation of the description. | |
Static Public Member Functions | |
| static csString | GetKeyString (iEventNameRegistry *reg, utf32_char code, const csKeyModifiers *mods, bool distinguishModifiers=true) |
| Helper function to return a string (eg. | |
| static csString | GetOtherString (iEventNameRegistry *reg, csEventID type, uint device, int num, const csKeyModifiers *mods, bool distinguishModifiers=true) |
| Helper function to return a string (eg. | |
| static bool | ParseKey (iEventNameRegistry *reg, const char *iStr, utf32_char *oKeyCode, utf32_char *oCookedCode, csKeyModifiers *oModifiers) |
| Helper function to parse a string (eg. | |
| static bool | ParseOther (iEventNameRegistry *reg, const char *iStr, csEventID *oType, uint *oDevice, int *oNumeric, csKeyModifiers *oModifiers) |
| Helper function to parse a string (eg. | |
Public Attributes | |
| csRef< iEventNameRegistry > | name_reg |
Protected Attributes | |
| csEventID | containedName |
| uint | deviceNumber |
| csKeyModifiers | modifiers |
| uint32 | modifiersHonored |
| utf32_char | code |
| bool | isCooked |
| int | joystickAxis |
| int | joystickButton |
| int | mouseAxis |
| int | mouseButton |
Friends | |
| class | csInputBinder |
Detailed Description
This class holds a description of a physical source of input events, such as a keyboard key, mouse or joystick button, or a mouse or joystick axis.
Definition at line 44 of file inputdef.h.
Constructor & Destructor Documentation
|
||||||||||||||||
|
Default constructor.
|
|
|
Copy constructor.
|
|
||||||||||||||||||||
|
Construct an input description from an iEvent (usually a button).
|
|
||||||||||||||||
|
Construct an input description from an iEvent (usually an axis).
|
|
||||||||||||||||||||
|
Construct an input description from a string.
|
Member Function Documentation
|
|
Returns a number indicating the relation of the two definitions.
Referenced by csComparator< csInputDefinition, csInputDefinition >::Compare(). |
|
|
Generate a hash value from the object.
Referenced by csHashComputer< csInputDefinition >::ComputeHash(). |
|
|
Returns the (basis-0) device number of the description.
Definition at line 176 of file inputdef.h. |
|
||||||||||||
|
Gives the key code of the description, assuming it is a keyboard type.
Definition at line 147 of file inputdef.h. References csevKeyboardEvent. |
|
||||||||||||||||||||
|
Helper function to return a string (eg. "Ctrl+A") from values describing a keyboard event.
|
|
|
Returns the keyboard modifiers of the description.
Definition at line 173 of file inputdef.h. |
|
|
Returns the event name of the description (a csev... constant).
Definition at line 136 of file inputdef.h. |
|
|
Returns the numeric value of the description.
Definition at line 163 of file inputdef.h. |
|
||||||||||||||||||||||||||||
|
Helper function to return a string (eg. "MouseX", "Alt+Mouse1") from values describing a non-keyboard event.
|
|
|
Returns a boolean indicating whether the object contains a valid input.
|
|
||||||||||||||||||||||||
|
Helper function to parse a string (eg. "Ctrl+A") into values describing a keyboard event, returning both raw and cooked key codes.
|
|
||||||||||||||||||||||||||||
|
Helper function to parse a string (eg. "MouseX", "Alt+Mouse1") into values describing a non-keyboard event.
|
|
|
Sets the key code of the description, assuming it is a keyboard type.
Definition at line 153 of file inputdef.h. References csevKeyboardEvent. |
|
|
Sets the keyboard modifiers of the description.
Definition at line 179 of file inputdef.h. |
|
|
Set the event type of the description (a csev... constant).
Definition at line 139 of file inputdef.h. |
|
|
Sets the numeric value of the description.
Definition at line 170 of file inputdef.h. |
|
|
Gets the string representation of the description.
|
The documentation for this class was generated from the following file:
- csutil/inputdef.h
Generated for Crystal Space by doxygen 1.4.6
