Introduction
Downloads
Documentation
Tutorials
Pixie Lite
Forum

Home

Platform_Input_KeyboardDevice Class Reference
[Platform]

Platform independent abstraction of a keyboard device. More...

Inheritance diagram for Platform_Input_KeyboardDevice:

Platform_NULL_Input_KeyboardDevice Platform_Win32_Input_KeyboardDevice

List of all members.


Public Types

enum  KeyCode {
  KEY_INVALID = 0x00, KEY_CANCEL = 0x03, KEY_BACK = 0x08, KEY_TAB = 0x09,
  KEY_CLEAR = 0x0C, KEY_RETURN = 0x0D, KEY_SHIFT = 0x10, KEY_CONTROL = 0x11,
  KEY_MENU = 0x12, KEY_CAPITAL = 0x14, KEY_ESCAPE = 0x1B, KEY_SPACE = 0x20,
  KEY_PRIOR = 0x21, KEY_NEXT = 0x22, KEY_END = 0x23, KEY_HOME = 0x24,
  KEY_LEFT = 0x25, KEY_UP = 0x26, KEY_RIGHT = 0x27, KEY_DOWN = 0x28,
  KEY_SELECT = 0x29, KEY_EXEC = 0x2B, KEY_SNAPSHOT = 0x2C, KEY_HELP = 0x2F,
  KEY_0 = 0x30, KEY_1 = 0x31, KEY_2 = 0x32, KEY_3 = 0x33,
  KEY_4 = 0x34, KEY_5 = 0x35, KEY_6 = 0x36, KEY_7 = 0x37,
  KEY_8 = 0x38, KEY_9 = 0x39, KEY_A = 0x41, KEY_B = 0x42,
  KEY_C = 0x43, KEY_D = 0x44, KEY_E = 0x45, KEY_F = 0x46,
  KEY_G = 0x47, KEY_H = 0x48, KEY_I = 0x49, KEY_J = 0x4A,
  KEY_K = 0x4B, KEY_L = 0x4C, KEY_M = 0x4D, KEY_N = 0x4E,
  KEY_O = 0x4F, KEY_P = 0x50, KEY_Q = 0x51, KEY_R = 0x52,
  KEY_S = 0x53, KEY_T = 0x54, KEY_U = 0x55, KEY_V = 0x56,
  KEY_W = 0x57, KEY_X = 0x58, KEY_Y = 0x59, KEY_Z = 0x5A,
  KEY_LWIN = 0x5B, KEY_RWIN = 0x5C, KEY_APPS = 0x5D, KEY_NUMPAD0 = 0x60,
  KEY_NUMPAD1 = 0x61, KEY_NUMPAD2 = 0x62, KEY_NUMPAD3 = 0x63, KEY_NUMPAD4 = 0x64,
  KEY_NUMPAD5 = 0x65, KEY_NUMPAD6 = 0x66, KEY_NUMPAD7 = 0x67, KEY_NUMPAD8 = 0x68,
  KEY_NUMPAD9 = 0x69, KEY_MULTIPLY = 0x6A, KEY_ADD = 0x6B, KEY_SEPARATOR = 0x6C,
  KEY_SUBTRACT = 0x6D, KEY_DECIMAL = 0x6E, KEY_DIVIDE = 0x6F, KEY_F1 = 0x70,
  KEY_F2 = 0x71, KEY_F3 = 0x72, KEY_F4 = 0x73, KEY_F5 = 0x74,
  KEY_F6 = 0x75, KEY_F7 = 0x76, KEY_F8 = 0x77, KEY_F9 = 0x78,
  KEY_F10 = 0x79, KEY_F11 = 0x7A, KEY_F12 = 0x7B, KEY_LSHIFT = 0xA0,
  KEY_RSHIFT = 0xA1, KEY_LCONTROL = 0xA2, KEY_RCONTROL = 0xA3, KEY_LMENU = 0xA4,
  KEY_RMENU = 0xA5, KEY_ATTN = 0xF6, KEY_CRSEL = 0xF7, KEY_EXSEL = 0xF8,
  KEY_EREOF = 0xF9, KEY_PLAY = 0xFA, KEY_ZOOM = 0xFB, KEY_NONAME = 0xFC,
  KEY_PA1 = 0xFD, KEYCODE_COUNT = 0xFF
}

Public Member Functions

virtual ~Platform_Input_KeyboardDevice ()
virtual bool IsKeyDown (KeyCode keyCode) const =0
virtual bool IsCharDown (char ascii) const =0
virtual void ClearBufferedCharacters () const =0
virtual int GetBufferedCharacterCount () const =0
virtual char GetBufferedCharacter (int index) const =0

Detailed Description

Platform independent abstraction of a keyboard device.

Author:
Mattias Gustavsson
Provides basic access to the keyboard - both by keycode (which is used for the physical keyes) and characters (which takes into account things like upper-lower case, shift/alt modifiers etc).

Todo:
Documentation of the buffered input methods

Definition at line 24 of file Platform_Input_KeyboardDevice.h.


Member Enumeration Documentation

Enumeration of all keys that can be tested. Currently, this is based on the windows set of keys - it is up to each platform specific implementation to try and re-map the platforms keys as closely as possible to the ones specified here. This list can and will be expanded as needed, when more platforms are supported by the Pixie Game Engine.

Enumerator:
KEY_INVALID  Not a valid key code.
KEY_CANCEL  Control-break processing.
KEY_BACK  BACKSPACE key.
KEY_TAB  TAB key.
KEY_CLEAR  CLEAR key.
KEY_RETURN  ENTER key.
KEY_SHIFT  SHIFT key.
KEY_CONTROL  CTRL key.
KEY_MENU  ALT key.
KEY_CAPITAL  CAPS LOCK key.
KEY_ESCAPE  ESC key.
KEY_SPACE  SPACEBAR key.
KEY_PRIOR  PAGE UP key.
KEY_NEXT  PAGE DOWN key.
KEY_END  END key.
KEY_HOME  HOME key.
KEY_LEFT  LEFT ARROW key.
KEY_UP  UP ARROW key.
KEY_RIGHT  RIGHT ARROW key.
KEY_DOWN  DOWN ARROW key.
KEY_SELECT  SELECT key.
KEY_EXEC  EXECUTE key.
KEY_SNAPSHOT  PRINT SCREEN key for Windows 3.0 and later.
KEY_HELP  HELP key.
KEY_0  0 key
KEY_1  1 key
KEY_2  2 key
KEY_3  3 key
KEY_4  4 key
KEY_5  5 key
KEY_6  6 key
KEY_7  7 key
KEY_8  8 key
KEY_9  9 key
KEY_A  A key.
KEY_B  B key.
KEY_C  C key.
KEY_D  D key.
KEY_E  E key.
KEY_F  F key.
KEY_G  G key.
KEY_H  H key.
KEY_I  I key.
KEY_J  J key.
KEY_K  K key.
KEY_L  L key.
KEY_M  M key.
KEY_N  N key.
KEY_O  O key.
KEY_P  P key.
KEY_Q  Q key.
KEY_R  R key.
KEY_S  S key.
KEY_T  T key.
KEY_U  U key.
KEY_V  V key.
KEY_W  W key.
KEY_X  X key.
KEY_Y  Y key.
KEY_Z  Z key.
KEY_LWIN 
KEY_RWIN 
KEY_APPS 
KEY_NUMPAD0  Numeric keypad 0 key.
KEY_NUMPAD1  Numeric keypad 1 key.
KEY_NUMPAD2  Numeric keypad 2 key.
KEY_NUMPAD3  Numeric keypad 3 key.
KEY_NUMPAD4  Numeric keypad 4 key.
KEY_NUMPAD5  Numeric keypad 5 key.
KEY_NUMPAD6  Numeric keypad 6 key.
KEY_NUMPAD7  Numeric keypad 7 key.
KEY_NUMPAD8  Numeric keypad 8 key.
KEY_NUMPAD9  Numeric keypad 9 key.
KEY_MULTIPLY  Asterisk (*) key.
KEY_ADD  Plus sign (+) key.
KEY_SEPARATOR  Separator key.
KEY_SUBTRACT  Minus sign (-) key.
KEY_DECIMAL  Period (.) key.
KEY_DIVIDE  Slash mark (/) key.
KEY_F1  F1.
KEY_F2  F2.
KEY_F3  F3.
KEY_F4  F4.
KEY_F5  F5.
KEY_F6  F6.
KEY_F7  F7.
KEY_F8  F8.
KEY_F9  F9.
KEY_F10  F10.
KEY_F11  F11.
KEY_F12  F12.
KEY_LSHIFT 
KEY_RSHIFT 
KEY_LCONTROL 
KEY_RCONTROL 
KEY_LMENU 
KEY_RMENU 
KEY_ATTN 
KEY_CRSEL 
KEY_EXSEL 
KEY_EREOF 
KEY_PLAY 
KEY_ZOOM 
KEY_NONAME 
KEY_PA1 
KEYCODE_COUNT 

Definition at line 78 of file Platform_Input_KeyboardDevice.h.


Constructor & Destructor Documentation

virtual Platform_Input_KeyboardDevice::~Platform_Input_KeyboardDevice (  )  [virtual]

Destructor

Definition at line 30 of file Platform_Input_KeyboardDevice.h.


Member Function Documentation

virtual bool Platform_Input_KeyboardDevice::IsKeyDown ( KeyCode  keyCode  )  const [pure virtual]

Checks if a key with the specified key code is currently held down See the KeyCode enum for more info on key codes.

Returns:
True if the specified key is held down, false if it isn't
Parameters:
keyCode The key code for the key to check

Implemented in Platform_NULL_Input_KeyboardDevice, and Platform_Win32_Input_KeyboardDevice.

virtual bool Platform_Input_KeyboardDevice::IsCharDown ( char  ascii  )  const [pure virtual]

Checks if the key, or combination of keys, representing the character with the specified ascii number is currently held down. Characters are different from keys, in that a combination of keys may be needed to produce certain characters, and in that key repeat effects may cause a character to be reported as alternately up and down, if held for a period of time.

Returns:
True if the character is held down, false if it isn't
Parameters:
ascii Ascii code of the character to check

Implemented in Platform_NULL_Input_KeyboardDevice, and Platform_Win32_Input_KeyboardDevice.

virtual void Platform_Input_KeyboardDevice::ClearBufferedCharacters (  )  const [pure virtual]

virtual int Platform_Input_KeyboardDevice::GetBufferedCharacterCount (  )  const [pure virtual]

virtual char Platform_Input_KeyboardDevice::GetBufferedCharacter ( int  index  )  const [pure virtual]



Pixie University and the Pixie Game Engine is created and managed by Mattias Gustavsson.
Reproduction/republishing of any material on this site without permission is strictly prohibited.