Xrb::Key Class Reference

Contains the function mapping for a single key/button. More...

#include <xrb_key.hpp>

Inheritance diagram for Xrb::Key:

Inheritance graph
[legend]

List of all members.

Public Types

enum  Code {
  INVALID = -1,
  NONE = -2,
  UNKNOWN = 0,
  LEFTMOUSE,
  MIDDLEMOUSE,
  RIGHTMOUSE,
  MOUSEWHEELUP,
  MOUSEWHEELDOWN,
  BACKSPACE,
  TAB = '\t',
  CLEAR,
  RETURN = '\r',
  PAUSE,
  ESCAPE = '\x1B',
  SPACE = ' ',
  QUOTE = '\'',
  COMMA = ',',
  MINUS = '-',
  PERIOD = '.',
  SLASH = '/',
  ZERO = '0',
  ONE = '1',
  TWO = '2',
  THREE = '3',
  FOUR = '4',
  FIVE = '5',
  SIX = '6',
  SEVEN = '7',
  EIGHT = '8',
  NINE = '9',
  SEMICOLON = ';',
  EQUALS = '=',
  LEFTBRACKET = '[',
  BACKSLASH = '\\',
  RIGHTBRACKET = ']',
  BACKQUOTE = '`',
  A = 'a',
  B = 'b',
  C = 'c',
  D = 'd',
  E = 'e',
  F = 'f',
  G = 'g',
  H = 'h',
  I = 'i',
  J = 'j',
  K = 'k',
  L = 'l',
  M = 'm',
  N = 'n',
  O = 'o',
  P = 'p',
  Q = 'q',
  R = 'r',
  S = 's',
  T = 't',
  U = 'u',
  V = 'v',
  W = 'w',
  X = 'x',
  Y = 'y',
  Z = 'z',
  DELETE = '\x7F',
  WORLD_0,
  WORLD_1,
  WORLD_2,
  WORLD_3,
  WORLD_4,
  WORLD_5,
  WORLD_6,
  WORLD_7,
  WORLD_8,
  WORLD_9,
  WORLD_10,
  WORLD_11,
  WORLD_12,
  WORLD_13,
  WORLD_14,
  WORLD_15,
  WORLD_16,
  WORLD_17,
  WORLD_18,
  WORLD_19,
  WORLD_20,
  WORLD_21,
  WORLD_22,
  WORLD_23,
  WORLD_24,
  WORLD_25,
  WORLD_26,
  WORLD_27,
  WORLD_28,
  WORLD_29,
  WORLD_30,
  WORLD_31,
  WORLD_32,
  WORLD_33,
  WORLD_34,
  WORLD_35,
  WORLD_36,
  WORLD_37,
  WORLD_38,
  WORLD_39,
  WORLD_40,
  WORLD_41,
  WORLD_42,
  WORLD_43,
  WORLD_44,
  WORLD_45,
  WORLD_46,
  WORLD_47,
  WORLD_48,
  WORLD_49,
  WORLD_50,
  WORLD_51,
  WORLD_52,
  WORLD_53,
  WORLD_54,
  WORLD_55,
  WORLD_56,
  WORLD_57,
  WORLD_58,
  WORLD_59,
  WORLD_60,
  WORLD_61,
  WORLD_62,
  WORLD_63,
  WORLD_64,
  WORLD_65,
  WORLD_66,
  WORLD_67,
  WORLD_68,
  WORLD_69,
  WORLD_70,
  WORLD_71,
  WORLD_72,
  WORLD_73,
  WORLD_74,
  WORLD_75,
  WORLD_76,
  WORLD_77,
  WORLD_78,
  WORLD_79,
  WORLD_80,
  WORLD_81,
  WORLD_82,
  WORLD_83,
  WORLD_84,
  WORLD_85,
  WORLD_86,
  WORLD_87,
  WORLD_88,
  WORLD_89,
  WORLD_90,
  WORLD_91,
  WORLD_92,
  WORLD_93,
  WORLD_94,
  WORLD_95,
  KP0,
  KP1,
  KP2,
  KP3,
  KP4,
  KP5,
  KP6,
  KP7,
  KP8,
  KP9,
  KP_PERIOD,
  KP_DIVIDE,
  KP_MULTIPLY,
  KP_MINUS,
  KP_PLUS,
  KP_ENTER,
  KP_EQUALS,
  UP,
  DOWN,
  RIGHT,
  LEFT,
  INSERT,
  HOME,
  END,
  PAGEUP,
  PAGEDOWN,
  F1,
  F2,
  F3,
  F4,
  F5,
  F6,
  F7,
  F8,
  F9,
  F10,
  F11,
  F12,
  F13,
  F14,
  F15,
  NUMLOCK,
  CAPSLOCK,
  SCROLLLOCK,
  RSHIFT,
  LSHIFT,
  RCTRL,
  LCTRL,
  RALT,
  LALT,
  RMETA,
  LMETA,
  LWINBLOWS,
  RWINBLOWS,
  MODE,
  COMPOSE,
  HELP,
  PRINT,
  SYSREQ,
  BREAK,
  MENU,
  POWER,
  EURO,
  UNDO
}
 All possible key codes that can be used by Key. More...
enum  Modifier {
  MOD_NONE = 0x0000,
  MOD_LSHIFT = 0x0001,
  MOD_RSHIFT = 0x0002,
  MOD_LCTRL = 0x0040,
  MOD_RCTRL = 0x0080,
  MOD_LALT = 0x0100,
  MOD_RALT = 0x0200,
  MOD_LMETA = 0x0400,
  MOD_RMETA = 0x0800,
  MOD_NUM = 0x1000,
  MOD_CAPS = 0x2000,
  MOD_MODE = 0x4000,
  MOD_SHIFT = MOD_LSHIFT|MOD_RSHIFT,
  MOD_ALT = MOD_LALT|MOD_RALT,
  MOD_CTRL = MOD_LCTRL|MOD_RCTRL
}
 Flags for key modifiers such as left-alt, caps lock, etc. More...

Public Member Functions

Key::Code GetCode () const
std::string const & Name () const
bool IsPressed () const
void ResetPressed ()

Static Public Member Functions

static KeyCreate (Key::Code key, std::string const &name)
static bool IsKeyRepeatable (Key::Code code)
static bool IsKeyAscii (Key::Code code)

Protected Member Functions

virtual bool HandleEvent (Event const *e)
 Subclasses must override this to provide the actual event handling necessary.


Detailed Description

Contains the function mapping for a single key/button.

Also provides static functions for converting between keycode types and checking if a particular keycode may generate EventKeyRepeat events.

Definition at line 28 of file xrb_key.hpp.


Member Enumeration Documentation

All possible key codes that can be used by Key.

These key codes were predicated on SDL's key codes, but are now separate. Ascii codes are used here when appropriate.

Definition at line 36 of file xrb_key.hpp.

Flags for key modifiers such as left-alt, caps lock, etc.

This enum isn't actually used in an instance of Key. Key is just being used for namespace scoping/organization.

Definition at line 267 of file xrb_key.hpp.


Member Function Documentation

bool Xrb::Key::HandleEvent ( Event const *  e  )  [protected, virtual]

Subclasses must override this to provide the actual event handling necessary.

ProcessEvent calls this function to do the subclass-specific event handling. Overrides of this function should return true if the event was used, otherwise false.

Implements Xrb::EventHandler.

Definition at line 95 of file xrb_key.cpp.

References Xrb::Event::GetEventType().


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

Hosted by SourceForge.net Logo -- Generated on Fri Aug 21 21:46:39 2009 for XuqRijBuh by doxygen 1.5.8