gcn::KeyEvent Class Reference

#include <keyevent.hpp>

Inheritance diagram for gcn::KeyEvent:

gcn::InputEvent gcn::Event List of all members.

Detailed Description

Represents a key event.

Definition at line 71 of file keyevent.hpp.

Public Types

enum  { PRESSED = 0, RELEASED }
 Key event types. More...

Public Member Functions

const KeygetKey () const
 Gets the key of the event.
unsigned int getType () const
 Gets the type of the event.
bool isNumericPad () const
 Checks if the key event occured on the numeric pad.
 KeyEvent (Widget *source, bool isShiftPressed, bool isControlPressed, bool isAltPressed, bool isMetaPressed, unsigned int type, bool isNumericPad, const Key &key)
 Constructor.
virtual ~KeyEvent ()
 Destructor.

Protected Attributes

bool mIsNumericPad
 True if the numeric pad was used, false otherwise.
Key mKey
 Holds the key of the key event.
unsigned int mType
 Holds the type of the key event.


Member Enumeration Documentation

anonymous enum

Key event types.

Enumerator:
PRESSED 
RELEASED 

Definition at line 77 of file keyevent.hpp.


Constructor & Destructor Documentation

gcn::KeyEvent::KeyEvent ( Widget source,
bool  isShiftPressed,
bool  isControlPressed,
bool  isAltPressed,
bool  isMetaPressed,
unsigned int  type,
bool  isNumericPad,
const Key key 
)

Constructor.

Parameters:
source The source widget of the event.
isShiftPressed True if shift is pressed, false otherwise.
isControlPressed True if control is pressed, false otherwise.
isAltPressed True if alt is pressed, false otherwise.
isMetaPressed True if meta is pressed, false otherwise.
type The type of the event. A value from KeyEventType.
isNumericPad True if the event occured on the numeric pad, false otherwise.
key The key of the event.

Definition at line 65 of file keyevent.cpp.


Member Function Documentation

const Key & gcn::KeyEvent::getKey (  )  const

Gets the key of the event.

Returns:
The key of the event.

Definition at line 100 of file keyevent.cpp.

References mKey.

Referenced by gcn::TextField::keyPressed(), gcn::TextBox::keyPressed(), gcn::TabbedArea::keyPressed(), gcn::Slider::keyPressed(), gcn::RadioButton::keyPressed(), gcn::ListBox::keyPressed(), gcn::DropDown::keyPressed(), gcn::CheckBox::keyPressed(), gcn::Button::keyPressed(), and gcn::Button::keyReleased().

unsigned int gcn::KeyEvent::getType (  )  const

Gets the type of the event.

Returns:
The type of the event.

Definition at line 90 of file keyevent.cpp.

References mType.

Referenced by gcn::Gui::distributeKeyEvent(), and gcn::Gui::distributeKeyEventToGlobalKeyListeners().

bool gcn::KeyEvent::isNumericPad (  )  const

Checks if the key event occured on the numeric pad.

Returns:
True if key event occured on the numeric pad, false otherwise.

Definition at line 95 of file keyevent.cpp.

References mIsNumericPad.


The documentation for this class was generated from the following files:
Generated on Sun Jan 20 21:48:15 2008 for Guichan by  doxygen 1.5.2