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

A class that represents a keyboard shortcut, usually for a menu item. More...

#include <omGUIInputKeyShortcut.h>

Public Member Functions

 KeyShortcut ()
 Create a default keyboard shortcut which doesn't correspond to any keyboard key. More...
 
 KeyShortcut (UTF32Char newCharacter)
 Create a keyboard shortcut for the specified character and the system default modifier(s). More...
 
 KeyShortcut (UTF32Char newCharacter, Modifiers::Flag modifier)
 Create a keyboard shortcut using the specified character and modifier. More...
 
 KeyShortcut (UTF32Char newCharacter, Modifiers::Flag modifier1, Modifiers::Flag modifier2)
 Create a keyboard shortcut using the specified character and 2 modifiers. More...
 
 KeyShortcut (UTF32Char newCharacter, Modifiers::Flag modifier1, Modifiers::Flag modifier2, Modifiers::Flag modifier3)
 Create a keyboard shortcut using the specified character and 3 modifiers. More...
 
UTF32Char getCharacter () const
 Return the character which this keyboard shortcut applies to. More...
 
void setCharacter (UTF32Char newCharacter)
 Set the character which this keyboard shortcut applies to. More...
 
const ModifiersgetModifiers () const
 Return an object representing the different modifier keys associated with this keyboard shortcut. More...
 
Bool hasModifiers () const
 Return whether or not this keyboard shortcut has any modifier keys set. More...
 
Bool hasModifier (Modifiers::Flag newModifier) const
 Return whether or not this keyboard shortcut has the specified modifier key set. More...
 
void setModifier (Modifiers::Flag newModifier, Bool isSet=true)
 Set whether or not the specified key modifier is set for this keyboard shortcut. More...
 
Bool operator== (const KeyShortcut &other) const
 Return whether or not this keyboard shortcut is exactly equal to another. More...
 
Bool operator!= (const KeyShortcut &other) const
 Return whether or not this keyboard shortcut is not equal to another. More...
 
Bool isValid () const
 Return whether or not this keyboard shortcut is valid and properly formed. More...
 
UTF8String toString () const
 Convert this keyboard shortcut to a human-readable string representation. More...
 

Static Public Attributes

static const Modifiers::Flag DEFAULT_MODIFIER = Modifiers::CONTROL
 The default modifier for the current system platform. More...
 

Detailed Description

A class that represents a keyboard shortcut, usually for a menu item.

This class describes the keys that the user must press together in order to execute a keyboard shortcut. Typically, keyboard shortcuts will be associated with specific menu items, allowing the user to quickly perform basic operations such as copy and paste without having to use the mouse.

Constructor & Destructor Documentation

om::gui::input::KeyShortcut::KeyShortcut ( )
inline

Create a default keyboard shortcut which doesn't correspond to any keyboard key.

om::gui::input::KeyShortcut::KeyShortcut ( UTF32Char  newCharacter)
inline

Create a keyboard shortcut for the specified character and the system default modifier(s).

om::gui::input::KeyShortcut::KeyShortcut ( UTF32Char  newCharacter,
Modifiers::Flag  modifier 
)
inline

Create a keyboard shortcut using the specified character and modifier.

om::gui::input::KeyShortcut::KeyShortcut ( UTF32Char  newCharacter,
Modifiers::Flag  modifier1,
Modifiers::Flag  modifier2 
)
inline

Create a keyboard shortcut using the specified character and 2 modifiers.

om::gui::input::KeyShortcut::KeyShortcut ( UTF32Char  newCharacter,
Modifiers::Flag  modifier1,
Modifiers::Flag  modifier2,
Modifiers::Flag  modifier3 
)
inline

Create a keyboard shortcut using the specified character and 3 modifiers.

Member Function Documentation

UTF32Char om::gui::input::KeyShortcut::getCharacter ( ) const
inline

Return the character which this keyboard shortcut applies to.

void om::gui::input::KeyShortcut::setCharacter ( UTF32Char  newCharacter)
inline

Set the character which this keyboard shortcut applies to.

const Modifiers& om::gui::input::KeyShortcut::getModifiers ( ) const
inline

Return an object representing the different modifier keys associated with this keyboard shortcut.

Bool om::gui::input::KeyShortcut::hasModifiers ( ) const
inline

Return whether or not this keyboard shortcut has any modifier keys set.

Bool om::gui::input::KeyShortcut::hasModifier ( Modifiers::Flag  newModifier) const
inline

Return whether or not this keyboard shortcut has the specified modifier key set.

void om::gui::input::KeyShortcut::setModifier ( Modifiers::Flag  newModifier,
Bool  isSet = true 
)
inline

Set whether or not the specified key modifier is set for this keyboard shortcut.

Bool om::gui::input::KeyShortcut::operator== ( const KeyShortcut other) const
inline

Return whether or not this keyboard shortcut is exactly equal to another.

Bool om::gui::input::KeyShortcut::operator!= ( const KeyShortcut other) const
inline

Return whether or not this keyboard shortcut is not equal to another.

Bool om::gui::input::KeyShortcut::isValid ( ) const
inline

Return whether or not this keyboard shortcut is valid and properly formed.

UTF8String om::gui::input::KeyShortcut::toString ( ) const

Convert this keyboard shortcut to a human-readable string representation.

The representation returned may differ, depending on the system platform.

Member Data Documentation

const Modifiers::Flag om::gui::input::KeyShortcut::DEFAULT_MODIFIER = Modifiers::CONTROL
static

The default modifier for the current system platform.


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