gcn::Key Class Reference

#include <key.hpp>

List of all members.


Detailed Description

Represents a key or a character.

Definition at line 67 of file key.hpp.

Public Types

enum  {
  SPACE = ' ', TAB = '\t', ENTER = '\n', LEFT_ALT = 1000,
  RIGHT_ALT, LEFT_SHIFT, RIGHT_SHIFT, LEFT_CONTROL,
  RIGHT_CONTROL, LEFT_META, RIGHT_META, LEFT_SUPER,
  RIGHT_SUPER, INSERT, HOME, PAGE_UP,
  DELETE, END, PAGE_DOWN, ESCAPE,
  CAPS_LOCK, BACKSPACE, F1, F2,
  F3, F4, F5, F6,
  F7, F8, F9, F10,
  F11, F12, F13, F14,
  F15, PRINT_SCREEN, SCROLL_LOCK, PAUSE,
  NUM_LOCK, ALT_GR, LEFT, RIGHT,
  UP, DOWN
}
 An enum with key values. More...

Public Member Functions

int getValue () const
 Gets the value of the key.
bool isCharacter () const
 Checks if a key is a character.
bool isLetter () const
 Checks if a key is a letter.
bool isNumber () const
 Checks if a key is a number.
 Key (int value=0)
 Constructor.

Protected Attributes

int mValue
 Holds the value of the key.


Member Enumeration Documentation

anonymous enum

An enum with key values.

Enumerator:
SPACE 
TAB 
ENTER 
LEFT_ALT 
RIGHT_ALT 
LEFT_SHIFT 
RIGHT_SHIFT 
LEFT_CONTROL 
RIGHT_CONTROL 
LEFT_META 
RIGHT_META 
LEFT_SUPER 
RIGHT_SUPER 
INSERT 
HOME 
PAGE_UP 
DELETE 
END 
PAGE_DOWN 
ESCAPE 
CAPS_LOCK 
BACKSPACE 
F1 
F2 
F3 
F4 
F5 
F6 
F7 
F8 
F9 
F10 
F11 
F12 
F13 
F14 
F15 
PRINT_SCREEN 
SCROLL_LOCK 
PAUSE 
NUM_LOCK 
ALT_GR 
LEFT 
RIGHT 
UP 
DOWN 

Definition at line 113 of file key.hpp.


Constructor & Destructor Documentation

gcn::Key::Key ( int  value = 0  ) 

Constructor.

Parameters:
value The ascii or enum value for the key.

Definition at line 65 of file key.cpp.


Member Function Documentation

int gcn::Key::getValue (  )  const

Gets the value of the key.

If an ascii value exists it will be returned. Otherwise an enum value will be returned.

Returns:
the value of the key.

Definition at line 90 of file key.cpp.

References mValue.

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().

bool gcn::Key::isCharacter (  )  const

Checks if a key is a character.

Returns:
True if the key is a letter, number or whitespace, false otherwise.

Definition at line 70 of file key.cpp.

References mValue.

Referenced by gcn::TextField::keyPressed(), and gcn::TextBox::keyPressed().

bool gcn::Key::isLetter (  )  const

Checks if a key is a letter.

Returns:
True if the key is a letter (a-z,A-Z), false otherwise.

Definition at line 82 of file key.cpp.

References mValue.

bool gcn::Key::isNumber (  )  const

Checks if a key is a number.

Returns:
True if the key is a number (0-9), false otherwise.

Definition at line 77 of file key.cpp.

References mValue.


Member Data Documentation

int gcn::Key::mValue [protected]

Holds the value of the key.

It may be an ascii value or an enum value.

Definition at line 168 of file key.hpp.

Referenced by getValue(), isCharacter(), isLetter(), and isNumber().


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