Keyboard.h

Go to the documentation of this file.
00001 
00002 //Luke Lenhart, 2008
00003 //See /docs/License.txt for details on how this code may be used.
00004 
00005 #pragma once
00006 #include "../base/Types.h"
00007 #include "Unified.h"
00008 #include <vector>
00009 
00010 namespace INPUT
00011 {
00013     namespace KEYBOARD
00014     {
00015         //normal typeables
00016         const uint8 A='A'; 
00017         const uint8 B='B'; 
00018         const uint8 C='C'; 
00019         const uint8 D='D'; 
00020         const uint8 E='E'; 
00021         const uint8 F='F'; 
00022         const uint8 G='G'; 
00023         const uint8 H='H'; 
00024         const uint8 I='I'; 
00025         const uint8 J='J'; 
00026         const uint8 K='K'; 
00027         const uint8 L='L'; 
00028         const uint8 M='M'; 
00029         const uint8 N='N'; 
00030         const uint8 O='O'; 
00031         const uint8 P='P'; 
00032         const uint8 Q='Q'; 
00033         const uint8 R='R'; 
00034         const uint8 S='S'; 
00035         const uint8 T='T'; 
00036         const uint8 U='U'; 
00037         const uint8 V='V'; 
00038         const uint8 W='W'; 
00039         const uint8 X='X'; 
00040         const uint8 Y='Y'; 
00041         const uint8 Z='Z'; 
00042         const uint8 NUM0='0'; 
00043         const uint8 NUM1='1'; 
00044         const uint8 NUM2='2'; 
00045         const uint8 NUM3='3'; 
00046         const uint8 NUM4='4'; 
00047         const uint8 NUM5='5'; 
00048         const uint8 NUM6='6'; 
00049         const uint8 NUM7='7'; 
00050         const uint8 NUM8='8'; 
00051         const uint8 NUM9='9'; 
00052         const uint8 SPACE=' '; 
00053         const uint8 TILDA='`'; 
00054         const uint8 LEFT_BRACKET='['; 
00055         const uint8 RIGHT_BRACKET=']'; 
00056         const uint8 QUOTE='\''; 
00057         const uint8 COMMA=','; 
00058         const uint8 PERIOD='.'; 
00059         const uint8 SLASH='/'; 
00060         const uint8 BACKSLASH='\\'; 
00061         const uint8 EQUALS='='; 
00062         const uint8 DASH='-'; 
00063         const uint8 COLON=';'; 
00064 
00065         //normal control keys
00066         const uint8 ENTER='\n'; 
00067         const uint8 TAB='\t'; 
00068         const uint8 BACKSPACE=130; 
00069         const uint8 ESCAPE=131; 
00070         const uint8 UP=140; 
00071         const uint8 DOWN=141; 
00072         const uint8 LEFT=142; 
00073         const uint8 RIGHT=143; 
00074         const uint8 INSERT=150; 
00075         const uint8 DELETE=151; 
00076         const uint8 HOME=152; 
00077         const uint8 END=153; 
00078         const uint8 PAGE_UP=154; 
00079         const uint8 PAGE_DOWN=155; 
00080         const uint8 F1=161; 
00081         const uint8 F2=162; 
00082         const uint8 F3=163; 
00083         const uint8 F4=164; 
00084         const uint8 F5=165; 
00085         const uint8 F6=166; 
00086         const uint8 F7=167; 
00087         const uint8 F8=168; 
00088         const uint8 F9=169; 
00089         const uint8 F10=170; 
00090         const uint8 F11=171; 
00091         const uint8 F12=172; 
00092 
00093         //numpad keys (not all keyboards have)
00094         const uint8 PAD0=200; 
00095         const uint8 PAD1=201; 
00096         const uint8 PAD2=202; 
00097         const uint8 PAD3=203; 
00098         const uint8 PAD4=204; 
00099         const uint8 PAD5=205; 
00100         const uint8 PAD6=206; 
00101         const uint8 PAD7=207; 
00102         const uint8 PAD8=208; 
00103         const uint8 PAD9=209; 
00104         const uint8 PAD_SLASH=210; 
00105         const uint8 PAD_STAR=211; 
00106         const uint8 PAD_MINUS=212; 
00107         const uint8 PAD_PLUS=213; 
00108         const uint8 PAD_DOT=214; 
00109         const uint8 PAD_ENTER=215; 
00110 
00111         //modifier keys
00112         const uint8 LEFT_SHIFT=230; 
00113         const uint8 RIGHT_SHIFT=231; 
00114         const uint8 LEFT_CONTROL=232; 
00115         const uint8 RIGHT_CONTROL=233; 
00116         const uint8 LEFT_ALT=234; 
00117         const uint8 RIGHT_ALT=235; 
00118 
00120         inline UnifiedButton GetUnifiedButton(uint8 key)
00121         {
00122             return UnifiedButton(KEYBOARD_DEVICE, key);
00123         }
00124 
00126         const std::string& GetFriendlyName(uint8 key);
00127 
00129         bool IsKeyDown(uint8 key);
00130 
00132         const std::vector<uint8>& GetCurrentlyPressedKeys();
00133 
00135         const std::vector<uint8>& GetNewlyPressedKeys();
00136 
00138         bool UpdateTypedText(std::string &textToEdit);
00139 
00141         void SetCaptureMode(bool captureTypedText, bool captureKeyState);
00142 
00144         bool IsCapturingText();
00145 
00147         bool IsCapturingState();
00148     }
00149 }

Generated on Sat Aug 9 15:05:05 2008 for MPMA Framework by  doxygen 1.5.6