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

A class representing a mouse button. More...

#include <omGUIInputMouseButton.h>

Public Member Functions

 MouseButton (MouseButtonCode buttonCode, const UTF8String &buttonName)
 Create a new mouse button with the specified code and name as a string. More...
 
MouseButtonCode getCode () const
 Return the integer mouse button code for this mouse button. More...
 
void setCode (MouseButtonCode newCode)
 Set the integer mouse button code for this mouse button. More...
 
 operator MouseButtonCode () const
 Convert this mouse button to an integer code. More...
 
Hash getHashCode () const
 Return an integer hash code for this mouse button. More...
 
const UTF8String & getName () const
 Return a const reference to a human-readable name for this mouse button. More...
 
void setName (const UTF8String &newName)
 Set the human-readable name for this mouse button. More...
 
const UTF8String & toString () const
 Return a const reference to this mouse button's string representation (its name). More...
 
 operator UTF8String () const
 Convert this mouse button to a string representation (its name). More...
 
Bool operator== (const MouseButton &button) const
 Test whether or not this button is equal to another. More...
 
Bool operator!= (const MouseButton &button) const
 Test whether or not this button is not equal to another. More...
 

Static Public Attributes

static const MouseButton UNDEFINED
 Unknown mouse button (used as a catch-all) More...
 
static const MouseButton MAIN
 The primary mouse button, usually an alias for the left button. More...
 
static const MouseButton LEFT
 Left mouse button. More...
 
static const MouseButton MIDDLE
 Middle mouse button. More...
 
static const MouseButton RIGHT
 Right mouse button. More...
 

Detailed Description

A class representing a mouse button.

There are several possible types of mouse buttons and they are accessed as public static members of the mouse button class. Each button is uniquely idenfitifed by an integer button code and has a name. User-defined mouse button types can also be created.

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

Constructor & Destructor Documentation

om::gui::input::MouseButton::MouseButton ( MouseButtonCode  buttonCode,
const UTF8String &  buttonName 
)
inline

Create a new mouse button with the specified code and name as a string.

Member Function Documentation

MouseButtonCode om::gui::input::MouseButton::getCode ( ) const
inline

Return the integer mouse button code for this mouse button.

void om::gui::input::MouseButton::setCode ( MouseButtonCode  newCode)
inline

Set the integer mouse button code for this mouse button.

om::gui::input::MouseButton::operator MouseButtonCode ( ) const
inline

Convert this mouse button to an integer code.

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

Return an integer hash code for this mouse button.

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

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

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

Set the human-readable name for this mouse button.

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

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

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

Convert this mouse button to a string representation (its name).

Bool om::gui::input::MouseButton::operator== ( const MouseButton button) const
inline

Test whether or not this button is equal to another.

This operator only compares the key codes.

Bool om::gui::input::MouseButton::operator!= ( const MouseButton button) const
inline

Test whether or not this button is not equal to another.

This operator only compares the key codes.

Member Data Documentation

const MouseButton om::gui::input::MouseButton::UNDEFINED
static

Unknown mouse button (used as a catch-all)

const MouseButton om::gui::input::MouseButton::MAIN
static

The primary mouse button, usually an alias for the left button.

Use this button to indicate the main mouse button that may depend on system setup or user settings (e.g. for left-handed people), used as the main interaction mode.

const MouseButton om::gui::input::MouseButton::LEFT
static

Left mouse button.

const MouseButton om::gui::input::MouseButton::MIDDLE
static

Middle mouse button.

const MouseButton om::gui::input::MouseButton::RIGHT
static

Right mouse button.


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