Om  1.0.0
A universal framework for multimedia simulation
Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
om::gui::input::Key Class Reference

A class that represents a single key on a keyboard. More...

#include <omGUIInputKey.h>

Public Member Functions

 Key ()
 Create a key with an undefined key code and no name. More...
 
 Key (KeyCode newCode, const UTF8String &newName)
 Create a key with the specified generic key code and name string. More...
 
KeyCode getCode () const
 Return the integer key code for this key. More...
 
void setCode (KeyCode newCode)
 Set the integer key code for this key. More...
 
 operator KeyCode () const
 Convert this key to an integer code. More...
 
Hash getHashCode () const
 Return an integer hash code for this key. More...
 
const UTF8String & getName () const
 Return a const reference to a human-readable name for this key. More...
 
void setName (const UTF8String &newName)
 Set the human-readable name for this key. More...
 
const UTF8String & toString () const
 Return a const reference to this key's string representation (its name). More...
 
 operator UTF8String () const
 Convert this key to a string representation (its name). More...
 
Bool operator== (const Key &key) const
 Return whether or not this key is equal to another key. More...
 
Bool operator!= (const Key &key) const
 Return whether or not this key is not equal to another key. More...
 

Static Public Member Functions

static Bool isPressed (const Key &key)
 Return whether or not a key is currently pressed based on the global system keyboard state. More...
 

Static Public Attributes

static const Key UNDEFINED
 A key that represents an undefined or invalid key. More...
 
static const Key A
 
static const Key B
 
static const Key C
 
static const Key D
 
static const Key E
 
static const Key F
 
static const Key G
 
static const Key H
 
static const Key I
 
static const Key J
 
static const Key K
 
static const Key L
 
static const Key M
 
static const Key N
 
static const Key O
 
static const Key P
 
static const Key Q
 
static const Key R
 
static const Key S
 
static const Key T
 
static const Key U
 
static const Key V
 
static const Key W
 
static const Key X
 
static const Key Y
 
static const Key Z
 
static const Key NUMBER_0
 
static const Key NUMBER_1
 
static const Key NUMBER_2
 
static const Key NUMBER_3
 
static const Key NUMBER_4
 
static const Key NUMBER_5
 
static const Key NUMBER_6
 
static const Key NUMBER_7
 
static const Key NUMBER_8
 
static const Key NUMBER_9
 
static const Key QUOTE
 
static const Key COMMA
 
static const Key HYPHEN
 
static const Key PERIOD
 
static const Key SLASH
 
static const Key SEMICOLON
 
static const Key EQUALS
 
static const Key OPEN_BRACKET
 
static const Key CLOSE_BRACKET
 
static const Key BACKSLASH
 
static const Key TILDE
 
static const Key KEYPAD_0
 
static const Key KEYPAD_1
 
static const Key KEYPAD_2
 
static const Key KEYPAD_3
 
static const Key KEYPAD_4
 
static const Key KEYPAD_5
 
static const Key KEYPAD_6
 
static const Key KEYPAD_7
 
static const Key KEYPAD_8
 
static const Key KEYPAD_9
 
static const Key KEYPAD_PERIOD
 
static const Key KEYPAD_SLASH
 
static const Key KEYPAD_ASTERISK
 
static const Key KEYPAD_HYPHEN
 
static const Key KEYPAD_PLUS
 
static const Key KEYPAD_ENTER
 
static const Key KEYPAD_EQUALS
 
static const Key KEYPAD_COMMA
 
static const Key KEYPAD_EQUALS_AS400
 
static const Key NUM_LOCK
 
static const Key CAPS_LOCK
 
static const Key SCROLL_LOCK
 
static const Key LEFT_SHIFT
 
static const Key RIGHT_SHIFT
 
static const Key LEFT_CONTROL
 
static const Key RIGHT_CONTROL
 
static const Key LEFT_ALT
 
static const Key RIGHT_ALT
 
static const Key LEFT_GUI
 
static const Key RIGHT_GUI
 
static const Key FUNCTION
 
static const Key LOCKING_CAPS_LOCK
 
static const Key LOCKING_NUM_LOCK
 
static const Key LOCKING_SCROLL_LOCK
 
static const Key UP_ARROW
 
static const Key DOWN_ARROW
 
static const Key LEFT_ARROW
 
static const Key RIGHT_ARROW
 
static const Key BACKSPACE
 
static const Key DELETE
 
static const Key TAB
 
static const Key CLEAR
 
static const Key RETURN
 
static const Key PAUSE
 
static const Key ESCAPE
 
static const Key SPACE
 
static const Key ALTERNATE_ERASE
 
static const Key ALTERNATE_RETURN
 
static const Key HELP
 
static const Key PRINT
 
static const Key SYS_REQ
 
static const Key MENU
 
static const Key POWER
 
static const Key UNDO
 
static const Key INSERT
 
static const Key HOME
 
static const Key END
 
static const Key PAGE_UP
 
static const Key PAGE_DOWN
 
static const Key APPLICATION
 
static const Key EXECUTE
 
static const Key SELECT
 
static const Key STOP
 
static const Key AGAIN
 
static const Key VOLUME_UP
 
static const Key VOLUME_DOWN
 
static const Key VOLUME_MUTE
 
static const Key CANCEL
 
static const Key PRIOR
 
static const Key SEPARATOR
 
static const Key OUT
 
static const Key OPERATE
 
static const Key CLEAR_OR_AGAIN
 
static const Key CR_SEL_OR_PROPS
 
static const Key EX_SEL
 
static const Key CUT
 
static const Key COPY
 
static const Key PASTE
 
static const Key FIND
 
static const Key F1
 
static const Key F2
 
static const Key F3
 
static const Key F4
 
static const Key F5
 
static const Key F6
 
static const Key F7
 
static const Key F8
 
static const Key F9
 
static const Key F10
 
static const Key F11
 
static const Key F12
 
static const Key F13
 
static const Key F14
 
static const Key F15
 
static const Key F16
 
static const Key F17
 
static const Key F18
 
static const Key F19
 
static const Key F20
 
static const Key F21
 
static const Key F22
 
static const Key F23
 
static const Key F24
 
static const Key INTERNATIONAL_1
 
static const Key INTERNATIONAL_2
 
static const Key INTERNATIONAL_3
 
static const Key INTERNATIONAL_4
 
static const Key INTERNATIONAL_5
 
static const Key INTERNATIONAL_6
 
static const Key INTERNATIONAL_7
 
static const Key INTERNATIONAL_8
 
static const Key INTERNATIONAL_9
 
static const Key LANGUAGE_1
 
static const Key LANGUAGE_2
 
static const Key LANGUAGE_3
 
static const Key LANGUAGE_4
 
static const Key LANGUAGE_5
 
static const Key LANGUAGE_6
 
static const Key LANGUAGE_7
 
static const Key LANGUAGE_8
 
static const Key LANGUAGE_9
 
static const Key NON_US_POUND
 
static const Key NON_US_BACKSLASH
 

Detailed Description

A class that represents a single key on a keyboard.

Each Key object has an integer key code, plus a human-readable name string for that key.

This class also provides statically-defined Key objects that encompass most types of keyboards. These objects can be queried directly as public static members or by hash table key code lookup.

Constructor & Destructor Documentation

om::gui::input::Key::Key ( )
inline

Create a key with an undefined key code and no name.

om::gui::input::Key::Key ( KeyCode  newCode,
const UTF8String &  newName 
)
inline

Create a key with the specified generic key code and name string.

Member Function Documentation

KeyCode om::gui::input::Key::getCode ( ) const
inline

Return the integer key code for this key.

void om::gui::input::Key::setCode ( KeyCode  newCode)
inline

Set the integer key code for this key.

om::gui::input::Key::operator KeyCode ( ) const
inline

Convert this key to an integer code.

Hash om::gui::input::Key::getHashCode ( ) const
inline

Return an integer hash code for this key.

const UTF8String& om::gui::input::Key::getName ( ) const
inline

Return a const reference to a human-readable name for this key.

void om::gui::input::Key::setName ( const UTF8String &  newName)
inline

Set the human-readable name for this key.

const UTF8String& om::gui::input::Key::toString ( ) const
inline

Return a const reference to this key's string representation (its name).

om::gui::input::Key::operator UTF8String ( ) const
inline

Convert this key to a string representation (its name).

Bool om::gui::input::Key::operator== ( const Key key) const
inline

Return whether or not this key is equal to another key.

This operator only compares the key codes.

Bool om::gui::input::Key::operator!= ( const Key key) const
inline

Return whether or not this key is not equal to another key.

This operator only compares the key codes.

static Bool om::gui::input::Key::isPressed ( const Key key)
static

Return whether or not a key is currently pressed based on the global system keyboard state.

Member Data Documentation

const Key om::gui::input::Key::UNDEFINED
static

A key that represents an undefined or invalid key.

const Key om::gui::input::Key::A
static
const Key om::gui::input::Key::B
static
const Key om::gui::input::Key::C
static
const Key om::gui::input::Key::D
static
const Key om::gui::input::Key::E
static
const Key om::gui::input::Key::F
static
const Key om::gui::input::Key::G
static
const Key om::gui::input::Key::H
static
const Key om::gui::input::Key::I
static
const Key om::gui::input::Key::J
static
const Key om::gui::input::Key::K
static
const Key om::gui::input::Key::L
static
const Key om::gui::input::Key::M
static
const Key om::gui::input::Key::N
static
const Key om::gui::input::Key::O
static
const Key om::gui::input::Key::P
static
const Key om::gui::input::Key::Q
static
const Key om::gui::input::Key::R
static
const Key om::gui::input::Key::S
static
const Key om::gui::input::Key::T
static
const Key om::gui::input::Key::U
static
const Key om::gui::input::Key::V
static
const Key om::gui::input::Key::W
static
const Key om::gui::input::Key::X
static
const Key om::gui::input::Key::Y
static
const Key om::gui::input::Key::Z
static
const Key om::gui::input::Key::NUMBER_0
static
const Key om::gui::input::Key::NUMBER_1
static
const Key om::gui::input::Key::NUMBER_2
static
const Key om::gui::input::Key::NUMBER_3
static
const Key om::gui::input::Key::NUMBER_4
static
const Key om::gui::input::Key::NUMBER_5
static
const Key om::gui::input::Key::NUMBER_6
static
const Key om::gui::input::Key::NUMBER_7
static
const Key om::gui::input::Key::NUMBER_8
static
const Key om::gui::input::Key::NUMBER_9
static
const Key om::gui::input::Key::QUOTE
static
const Key om::gui::input::Key::COMMA
static
const Key om::gui::input::Key::HYPHEN
static
const Key om::gui::input::Key::PERIOD
static
const Key om::gui::input::Key::SLASH
static
const Key om::gui::input::Key::SEMICOLON
static
const Key om::gui::input::Key::EQUALS
static
const Key om::gui::input::Key::OPEN_BRACKET
static
const Key om::gui::input::Key::CLOSE_BRACKET
static
const Key om::gui::input::Key::BACKSLASH
static
const Key om::gui::input::Key::TILDE
static
const Key om::gui::input::Key::KEYPAD_0
static
const Key om::gui::input::Key::KEYPAD_1
static
const Key om::gui::input::Key::KEYPAD_2
static
const Key om::gui::input::Key::KEYPAD_3
static
const Key om::gui::input::Key::KEYPAD_4
static
const Key om::gui::input::Key::KEYPAD_5
static
const Key om::gui::input::Key::KEYPAD_6
static
const Key om::gui::input::Key::KEYPAD_7
static
const Key om::gui::input::Key::KEYPAD_8
static
const Key om::gui::input::Key::KEYPAD_9
static
const Key om::gui::input::Key::KEYPAD_PERIOD
static
const Key om::gui::input::Key::KEYPAD_SLASH
static
const Key om::gui::input::Key::KEYPAD_ASTERISK
static
const Key om::gui::input::Key::KEYPAD_HYPHEN
static
const Key om::gui::input::Key::KEYPAD_PLUS
static
const Key om::gui::input::Key::KEYPAD_ENTER
static
const Key om::gui::input::Key::KEYPAD_EQUALS
static
const Key om::gui::input::Key::KEYPAD_COMMA
static
const Key om::gui::input::Key::KEYPAD_EQUALS_AS400
static
const Key om::gui::input::Key::NUM_LOCK
static
const Key om::gui::input::Key::CAPS_LOCK
static
const Key om::gui::input::Key::SCROLL_LOCK
static
const Key om::gui::input::Key::LEFT_SHIFT
static
const Key om::gui::input::Key::RIGHT_SHIFT
static
const Key om::gui::input::Key::LEFT_CONTROL
static
const Key om::gui::input::Key::RIGHT_CONTROL
static
const Key om::gui::input::Key::LEFT_ALT
static
const Key om::gui::input::Key::RIGHT_ALT
static
const Key om::gui::input::Key::LEFT_GUI
static
const Key om::gui::input::Key::RIGHT_GUI
static
const Key om::gui::input::Key::FUNCTION
static
const Key om::gui::input::Key::LOCKING_CAPS_LOCK
static
const Key om::gui::input::Key::LOCKING_NUM_LOCK
static
const Key om::gui::input::Key::LOCKING_SCROLL_LOCK
static
const Key om::gui::input::Key::UP_ARROW
static
const Key om::gui::input::Key::DOWN_ARROW
static
const Key om::gui::input::Key::LEFT_ARROW
static
const Key om::gui::input::Key::RIGHT_ARROW
static
const Key om::gui::input::Key::BACKSPACE
static
const Key om::gui::input::Key::DELETE
static
const Key om::gui::input::Key::TAB
static
const Key om::gui::input::Key::CLEAR
static
const Key om::gui::input::Key::RETURN
static
const Key om::gui::input::Key::PAUSE
static
const Key om::gui::input::Key::ESCAPE
static
const Key om::gui::input::Key::SPACE
static
const Key om::gui::input::Key::ALTERNATE_ERASE
static
const Key om::gui::input::Key::ALTERNATE_RETURN
static
const Key om::gui::input::Key::HELP
static
const Key om::gui::input::Key::PRINT
static
const Key om::gui::input::Key::SYS_REQ
static
const Key om::gui::input::Key::MENU
static
const Key om::gui::input::Key::POWER
static
const Key om::gui::input::Key::UNDO
static
const Key om::gui::input::Key::INSERT
static
const Key om::gui::input::Key::HOME
static
const Key om::gui::input::Key::END
static
const Key om::gui::input::Key::PAGE_UP
static
const Key om::gui::input::Key::PAGE_DOWN
static
const Key om::gui::input::Key::APPLICATION
static
const Key om::gui::input::Key::EXECUTE
static
const Key om::gui::input::Key::SELECT
static
const Key om::gui::input::Key::STOP
static
const Key om::gui::input::Key::AGAIN
static
const Key om::gui::input::Key::VOLUME_UP
static
const Key om::gui::input::Key::VOLUME_DOWN
static
const Key om::gui::input::Key::VOLUME_MUTE
static
const Key om::gui::input::Key::CANCEL
static
const Key om::gui::input::Key::PRIOR
static
const Key om::gui::input::Key::SEPARATOR
static
const Key om::gui::input::Key::OUT
static
const Key om::gui::input::Key::OPERATE
static
const Key om::gui::input::Key::CLEAR_OR_AGAIN
static
const Key om::gui::input::Key::CR_SEL_OR_PROPS
static
const Key om::gui::input::Key::EX_SEL
static
const Key om::gui::input::Key::CUT
static
const Key om::gui::input::Key::COPY
static
const Key om::gui::input::Key::PASTE
static
const Key om::gui::input::Key::FIND
static
const Key om::gui::input::Key::F1
static
const Key om::gui::input::Key::F2
static
const Key om::gui::input::Key::F3
static
const Key om::gui::input::Key::F4
static
const Key om::gui::input::Key::F5
static
const Key om::gui::input::Key::F6
static
const Key om::gui::input::Key::F7
static
const Key om::gui::input::Key::F8
static
const Key om::gui::input::Key::F9
static
const Key om::gui::input::Key::F10
static
const Key om::gui::input::Key::F11
static
const Key om::gui::input::Key::F12
static
const Key om::gui::input::Key::F13
static
const Key om::gui::input::Key::F14
static
const Key om::gui::input::Key::F15
static
const Key om::gui::input::Key::F16
static
const Key om::gui::input::Key::F17
static
const Key om::gui::input::Key::F18
static
const Key om::gui::input::Key::F19
static
const Key om::gui::input::Key::F20
static
const Key om::gui::input::Key::F21
static
const Key om::gui::input::Key::F22
static
const Key om::gui::input::Key::F23
static
const Key om::gui::input::Key::F24
static
const Key om::gui::input::Key::INTERNATIONAL_1
static
const Key om::gui::input::Key::INTERNATIONAL_2
static
const Key om::gui::input::Key::INTERNATIONAL_3
static
const Key om::gui::input::Key::INTERNATIONAL_4
static
const Key om::gui::input::Key::INTERNATIONAL_5
static
const Key om::gui::input::Key::INTERNATIONAL_6
static
const Key om::gui::input::Key::INTERNATIONAL_7
static
const Key om::gui::input::Key::INTERNATIONAL_8
static
const Key om::gui::input::Key::INTERNATIONAL_9
static
const Key om::gui::input::Key::LANGUAGE_1
static
const Key om::gui::input::Key::LANGUAGE_2
static
const Key om::gui::input::Key::LANGUAGE_3
static
const Key om::gui::input::Key::LANGUAGE_4
static
const Key om::gui::input::Key::LANGUAGE_5
static
const Key om::gui::input::Key::LANGUAGE_6
static
const Key om::gui::input::Key::LANGUAGE_7
static
const Key om::gui::input::Key::LANGUAGE_8
static
const Key om::gui::input::Key::LANGUAGE_9
static
const Key om::gui::input::Key::NON_US_POUND
static
const Key om::gui::input::Key::NON_US_BACKSLASH
static

The documentation for this class was generated from the following file: