A ButtonHandle represents a single button from any device, including keyboard buttons and mouse buttons (but see KeyboardButton and MouseButton). More...
Public Member Functions | |
ButtonHandle () | |
The default constructor must do nothing, because we can't guarantee ordering of static initializers. | |
ButtonHandle (int index) | |
Constructs a ButtonHandle with the corresponding index number, which may have been returned by an earlier call to ButtonHandle::get_index(). | |
ButtonHandle | getAlias () |
Returns the alias (alternate name) associated with the button, if any, or ButtonHandle::none() if the button has no alias. | |
char | getAsciiEquivalent () |
Returns the character code associated with the button, or '\0' if no ASCII code was associated. | |
int | getIndex () |
Returns the integer index associated with this ButtonHandle. | |
string | getName () |
Returns the name of the button. | |
bool | hasAsciiEquivalent () |
Returns true if the button was created with an ASCII equivalent code (e.g. | |
bool | matches (ButtonHandle const other) |
Returns true if this ButtonHandle is the same as the other one, or if the other one is an alias for this one. | |
output (ostream out) | |
Static Public Member Functions | |
static TypeHandle | getClassType () |
static ButtonHandle | none () |
Returns a special zero-valued ButtonHandle that is used to indicate no button. |
A ButtonHandle represents a single button from any device, including keyboard buttons and mouse buttons (but see KeyboardButton and MouseButton).
ButtonHandle | ( | ) |
The default constructor must do nothing, because we can't guarantee ordering of static initializers.
If the constructor tried to initialize its value, it might happen after the value had already been set previously by another static initializer!
ButtonHandle | ( | int | index | ) |
Constructs a ButtonHandle with the corresponding index number, which may have been returned by an earlier call to ButtonHandle::get_index().
ButtonHandle getAlias | ( | ) |
Returns the alias (alternate name) associated with the button, if any, or ButtonHandle::none() if the button has no alias.
Each button is allowed to have one alias, and multiple different buttons can refer to the same alias. The alias should be the more general name for the button, for instance, shift is an alias for lshift, but not vice-versa.
Returns the character code associated with the button, or '\0' if no ASCII code was associated.
static TypeHandle getClassType | ( | ) | [static] |
Returns the integer index associated with this ButtonHandle.
Each different ButtonHandle will have a different index. However, you probably shouldn't be using this method; you should just treat the ButtonHandles as opaque classes. This is provided for the convenience of non-C++ scripting languages to build a hashtable of ButtonHandles.
string getName | ( | ) |
Returns the name of the button.
bool hasAsciiEquivalent | ( | ) |
Returns true if the button was created with an ASCII equivalent code (e.g.
for a standard keyboard button).
bool matches | ( | ButtonHandle const | other | ) |
Returns true if this ButtonHandle is the same as the other one, or if the other one is an alias for this one.
(Does not return true if this button is an alias for the other one, however.)
This is a more general comparison than operator ==.
static ButtonHandle none | ( | ) | [static] |
Returns a special zero-valued ButtonHandle that is used to indicate no button.