KeyTypes.h

00001 /*
00002  * synergy -- mouse and keyboard sharing utility
00003  * Copyright (C) 2002 Chris Schoeneman
00004  * 
00005  * This package is free software; you can redistribute it and/or
00006  * modify it under the terms of the GNU General Public License
00007  * found in the file COPYING that should have accompanied this file.
00008  * 
00009  * This package is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  * GNU General Public License for more details.
00013  */
00014 
00015 #ifndef KEYTYPES_H
00016 #define KEYTYPES_H
00017 
00018 #include "BasicTypes.h"
00019 
00021 
00026 typedef UInt32          KeyID;
00027 
00029 
00035 typedef UInt16          KeyButton;
00036 
00038 
00041 typedef UInt32          KeyModifierMask;
00042 
00044 
00047 typedef UInt32          KeyModifierID;
00048 
00050 
00051 static const KeyModifierMask    KeyModifierShift      = 0x0001;
00052 static const KeyModifierMask    KeyModifierControl    = 0x0002;
00053 static const KeyModifierMask    KeyModifierAlt        = 0x0004;
00054 static const KeyModifierMask    KeyModifierMeta       = 0x0008;
00055 static const KeyModifierMask    KeyModifierSuper      = 0x0010;
00056 static const KeyModifierMask    KeyModifierAltGr      = 0x0020;
00057 static const KeyModifierMask    KeyModifierCapsLock   = 0x1000;
00058 static const KeyModifierMask    KeyModifierNumLock    = 0x2000;
00059 static const KeyModifierMask    KeyModifierScrollLock = 0x4000;
00061 
00063 
00064 static const UInt32             kKeyModifierBitNone       = 16;
00065 static const UInt32             kKeyModifierBitShift      = 0;
00066 static const UInt32             kKeyModifierBitControl    = 1;
00067 static const UInt32             kKeyModifierBitAlt        = 2;
00068 static const UInt32             kKeyModifierBitMeta       = 3;
00069 static const UInt32             kKeyModifierBitSuper      = 4;
00070 static const UInt32             kKeyModifierBitAltGr      = 5;
00071 static const UInt32             kKeyModifierBitCapsLock   = 12;
00072 static const UInt32             kKeyModifierBitNumLock    = 13;
00073 static const UInt32             kKeyModifierBitScrollLock = 14;
00074 static const SInt32             kKeyModifierNumBits       = 16;
00076 
00078 
00079 static const KeyModifierID      kKeyModifierIDNull     = 0;
00080 static const KeyModifierID      kKeyModifierIDShift    = 1;
00081 static const KeyModifierID      kKeyModifierIDControl  = 2;
00082 static const KeyModifierID      kKeyModifierIDAlt      = 3;
00083 static const KeyModifierID      kKeyModifierIDMeta     = 4;
00084 static const KeyModifierID      kKeyModifierIDSuper    = 5;
00085 static const KeyModifierID      kKeyModifierIDLast     = 6;
00087 
00089 
00090 // all identifiers except kKeyNone and those in 0xE000 to 0xE0FF
00091 // inclusive are equal to the corresponding X11 keysym - 0x1000.
00092 
00093 // no key
00094 static const KeyID      kKeyNone        = 0x0000;
00095 
00096 // TTY functions
00097 static const KeyID      kKeyBackSpace   = 0xEF08;   /* back space, back char */
00098 static const KeyID      kKeyTab         = 0xEF09;
00099 static const KeyID      kKeyLinefeed    = 0xEF0A;   /* Linefeed, LF */
00100 static const KeyID      kKeyClear       = 0xEF0B;
00101 static const KeyID      kKeyReturn      = 0xEF0D;   /* Return, enter */
00102 static const KeyID      kKeyPause       = 0xEF13;   /* Pause, hold */
00103 static const KeyID      kKeyScrollLock  = 0xEF14;
00104 static const KeyID      kKeySysReq      = 0xEF15;
00105 static const KeyID      kKeyEscape      = 0xEF1B;
00106 static const KeyID      kKeyHenkan      = 0xEF23;   /* Start/Stop Conversion */
00107 static const KeyID      kKeyHangulKana  = 0xEF26;   /* Hangul, Kana */
00108 static const KeyID      kKeyHiraganaKatakana = 0xEF27;  /* Hiragana/Katakana toggle */
00109 static const KeyID      kKeyZenkaku     = 0xEF2A;   /* Zenkaku/Hankaku */
00110 static const KeyID      kKeyHanjaKanzi  = 0xEF2A;   /* Hanja, Kanzi */
00111 static const KeyID      kKeyDelete      = 0xEFFF;   /* Delete, rubout */
00112 
00113 // cursor control
00114 static const KeyID      kKeyHome        = 0xEF50;
00115 static const KeyID      kKeyLeft        = 0xEF51;   /* Move left, left arrow */
00116 static const KeyID      kKeyUp          = 0xEF52;   /* Move up, up arrow */
00117 static const KeyID      kKeyRight       = 0xEF53;   /* Move right, right arrow */
00118 static const KeyID      kKeyDown        = 0xEF54;   /* Move down, down arrow */
00119 static const KeyID      kKeyPageUp      = 0xEF55;
00120 static const KeyID      kKeyPageDown    = 0xEF56;
00121 static const KeyID      kKeyEnd         = 0xEF57;   /* EOL */
00122 static const KeyID      kKeyBegin       = 0xEF58;   /* BOL */
00123 
00124 // misc functions
00125 static const KeyID      kKeySelect      = 0xEF60;   /* Select, mark */
00126 static const KeyID      kKeyPrint       = 0xEF61;
00127 static const KeyID      kKeyExecute     = 0xEF62;   /* Execute, run, do */
00128 static const KeyID      kKeyInsert      = 0xEF63;   /* Insert, insert here */
00129 static const KeyID      kKeyUndo        = 0xEF65;   /* Undo, oops */
00130 static const KeyID      kKeyRedo        = 0xEF66;   /* redo, again */
00131 static const KeyID      kKeyMenu        = 0xEF67;
00132 static const KeyID      kKeyFind        = 0xEF68;   /* Find, search */
00133 static const KeyID      kKeyCancel      = 0xEF69;   /* Cancel, stop, abort, exit */
00134 static const KeyID      kKeyHelp        = 0xEF6A;   /* Help */
00135 static const KeyID      kKeyBreak       = 0xEF6B;
00136 static const KeyID      kKeyAltGr       = 0xEF7E;   /* Character set switch */
00137 static const KeyID      kKeyNumLock     = 0xEF7F;
00138 
00139 // keypad
00140 static const KeyID      kKeyKP_Space    = 0xEF80;   /* space */
00141 static const KeyID      kKeyKP_Tab      = 0xEF89;
00142 static const KeyID      kKeyKP_Enter    = 0xEF8D;   /* enter */
00143 static const KeyID      kKeyKP_F1       = 0xEF91;   /* PF1, KP_A, ... */
00144 static const KeyID      kKeyKP_F2       = 0xEF92;
00145 static const KeyID      kKeyKP_F3       = 0xEF93;
00146 static const KeyID      kKeyKP_F4       = 0xEF94;
00147 static const KeyID      kKeyKP_Home     = 0xEF95;
00148 static const KeyID      kKeyKP_Left     = 0xEF96;
00149 static const KeyID      kKeyKP_Up       = 0xEF97;
00150 static const KeyID      kKeyKP_Right    = 0xEF98;
00151 static const KeyID      kKeyKP_Down     = 0xEF99;
00152 static const KeyID      kKeyKP_PageUp   = 0xEF9A;
00153 static const KeyID      kKeyKP_PageDown = 0xEF9B;
00154 static const KeyID      kKeyKP_End      = 0xEF9C;
00155 static const KeyID      kKeyKP_Begin    = 0xEF9D;
00156 static const KeyID      kKeyKP_Insert   = 0xEF9E;
00157 static const KeyID      kKeyKP_Delete   = 0xEF9F;
00158 static const KeyID      kKeyKP_Equal    = 0xEFBD;   /* equals */
00159 static const KeyID      kKeyKP_Multiply = 0xEFAA;
00160 static const KeyID      kKeyKP_Add      = 0xEFAB;
00161 static const KeyID      kKeyKP_Separator= 0xEFAC;   /* separator, often comma */
00162 static const KeyID      kKeyKP_Subtract = 0xEFAD;
00163 static const KeyID      kKeyKP_Decimal  = 0xEFAE;
00164 static const KeyID      kKeyKP_Divide   = 0xEFAF;
00165 static const KeyID      kKeyKP_0        = 0xEFB0; 
00166 static const KeyID      kKeyKP_1        = 0xEFB1;
00167 static const KeyID      kKeyKP_2        = 0xEFB2;
00168 static const KeyID      kKeyKP_3        = 0xEFB3;
00169 static const KeyID      kKeyKP_4        = 0xEFB4;
00170 static const KeyID      kKeyKP_5        = 0xEFB5;
00171 static const KeyID      kKeyKP_6        = 0xEFB6;
00172 static const KeyID      kKeyKP_7        = 0xEFB7;
00173 static const KeyID      kKeyKP_8        = 0xEFB8;
00174 static const KeyID      kKeyKP_9        = 0xEFB9;
00175 
00176 // function keys
00177 static const KeyID      kKeyF1          = 0xEFBE;
00178 static const KeyID      kKeyF2          = 0xEFBF;
00179 static const KeyID      kKeyF3          = 0xEFC0;
00180 static const KeyID      kKeyF4          = 0xEFC1;
00181 static const KeyID      kKeyF5          = 0xEFC2;
00182 static const KeyID      kKeyF6          = 0xEFC3;
00183 static const KeyID      kKeyF7          = 0xEFC4;
00184 static const KeyID      kKeyF8          = 0xEFC5;
00185 static const KeyID      kKeyF9          = 0xEFC6;
00186 static const KeyID      kKeyF10         = 0xEFC7;
00187 static const KeyID      kKeyF11         = 0xEFC8;
00188 static const KeyID      kKeyF12         = 0xEFC9;
00189 static const KeyID      kKeyF13         = 0xEFCA;
00190 static const KeyID      kKeyF14         = 0xEFCB;
00191 static const KeyID      kKeyF15         = 0xEFCC;
00192 static const KeyID      kKeyF16         = 0xEFCD;
00193 static const KeyID      kKeyF17         = 0xEFCE;
00194 static const KeyID      kKeyF18         = 0xEFCF;
00195 static const KeyID      kKeyF19         = 0xEFD0;
00196 static const KeyID      kKeyF20         = 0xEFD1;
00197 static const KeyID      kKeyF21         = 0xEFD2;
00198 static const KeyID      kKeyF22         = 0xEFD3;
00199 static const KeyID      kKeyF23         = 0xEFD4;
00200 static const KeyID      kKeyF24         = 0xEFD5;
00201 static const KeyID      kKeyF25         = 0xEFD6;
00202 static const KeyID      kKeyF26         = 0xEFD7;
00203 static const KeyID      kKeyF27         = 0xEFD8;
00204 static const KeyID      kKeyF28         = 0xEFD9;
00205 static const KeyID      kKeyF29         = 0xEFDA;
00206 static const KeyID      kKeyF30         = 0xEFDB;
00207 static const KeyID      kKeyF31         = 0xEFDC;
00208 static const KeyID      kKeyF32         = 0xEFDD;
00209 static const KeyID      kKeyF33         = 0xEFDE;
00210 static const KeyID      kKeyF34         = 0xEFDF;
00211 static const KeyID      kKeyF35         = 0xEFE0;
00212 
00213 // modifiers
00214 static const KeyID      kKeyShift_L     = 0xEFE1;   /* Left shift */
00215 static const KeyID      kKeyShift_R     = 0xEFE2;   /* Right shift */
00216 static const KeyID      kKeyControl_L   = 0xEFE3;   /* Left control */
00217 static const KeyID      kKeyControl_R   = 0xEFE4;   /* Right control */
00218 static const KeyID      kKeyCapsLock    = 0xEFE5;   /* Caps lock */
00219 static const KeyID      kKeyShiftLock   = 0xEFE6;   /* Shift lock */
00220 static const KeyID      kKeyMeta_L      = 0xEFE7;   /* Left meta */
00221 static const KeyID      kKeyMeta_R      = 0xEFE8;   /* Right meta */
00222 static const KeyID      kKeyAlt_L       = 0xEFE9;   /* Left alt */
00223 static const KeyID      kKeyAlt_R       = 0xEFEA;   /* Right alt */
00224 static const KeyID      kKeySuper_L     = 0xEFEB;   /* Left super */
00225 static const KeyID      kKeySuper_R     = 0xEFEC;   /* Right super */
00226 static const KeyID      kKeyHyper_L     = 0xEFED;   /* Left hyper */
00227 static const KeyID      kKeyHyper_R     = 0xEFEE;   /* Right hyper */
00228 
00229 // multi-key character composition
00230 static const KeyID      kKeyCompose         = 0xEF20;
00231 static const KeyID      kKeyDeadGrave       = 0x0300;
00232 static const KeyID      kKeyDeadAcute       = 0x0301;
00233 static const KeyID      kKeyDeadCircumflex  = 0x0302;
00234 static const KeyID      kKeyDeadTilde       = 0x0303;
00235 static const KeyID      kKeyDeadMacron      = 0x0304;
00236 static const KeyID      kKeyDeadBreve       = 0x0306;
00237 static const KeyID      kKeyDeadAbovedot    = 0x0307;
00238 static const KeyID      kKeyDeadDiaeresis   = 0x0308;
00239 static const KeyID      kKeyDeadAbovering   = 0x030a;
00240 static const KeyID      kKeyDeadDoubleacute = 0x030b;
00241 static const KeyID      kKeyDeadCaron       = 0x030c;
00242 static const KeyID      kKeyDeadCedilla     = 0x0327;
00243 static const KeyID      kKeyDeadOgonek      = 0x0328;
00244 
00245 // more function and modifier keys
00246 static const KeyID      kKeyLeftTab         = 0xEE20;
00247 
00248 // update modifiers
00249 static const KeyID      kKeySetModifiers    = 0xEE06;
00250 static const KeyID      kKeyClearModifiers  = 0xEE07;
00251 
00252 // group change
00253 static const KeyID      kKeyNextGroup       = 0xEE08;
00254 static const KeyID      kKeyPrevGroup       = 0xEE0A;
00255 
00256 // extended keys
00257 static const KeyID      kKeyEject           = 0xE001;
00258 static const KeyID      kKeySleep           = 0xE05F;
00259 static const KeyID      kKeyWWWBack         = 0xE0A6;
00260 static const KeyID      kKeyWWWForward      = 0xE0A7;
00261 static const KeyID      kKeyWWWRefresh      = 0xE0A8;
00262 static const KeyID      kKeyWWWStop         = 0xE0A9;
00263 static const KeyID      kKeyWWWSearch       = 0xE0AA;
00264 static const KeyID      kKeyWWWFavorites    = 0xE0AB;
00265 static const KeyID      kKeyWWWHome         = 0xE0AC;
00266 static const KeyID      kKeyAudioMute       = 0xE0AD;
00267 static const KeyID      kKeyAudioDown       = 0xE0AE;
00268 static const KeyID      kKeyAudioUp         = 0xE0AF;
00269 static const KeyID      kKeyAudioNext       = 0xE0B0;
00270 static const KeyID      kKeyAudioPrev       = 0xE0B1;
00271 static const KeyID      kKeyAudioStop       = 0xE0B2;
00272 static const KeyID      kKeyAudioPlay       = 0xE0B3;
00273 static const KeyID      kKeyAppMail         = 0xE0B4;
00274 static const KeyID      kKeyAppMedia        = 0xE0B5;
00275 static const KeyID      kKeyAppUser1        = 0xE0B6;
00276 static const KeyID      kKeyAppUser2        = 0xE0B7;
00277 
00279 
00280 struct KeyNameMapEntry {
00281 public:
00282     const char*         m_name;
00283     KeyID               m_id;
00284 };
00285 struct KeyModifierNameMapEntry {
00286 public:
00287     const char*         m_name;
00288     KeyModifierMask     m_mask;
00289 };
00290 
00292 
00297 extern const KeyNameMapEntry kKeyNameMap[];
00298 
00300 
00304 extern const KeyModifierNameMapEntry kModifierNameMap[];
00305 
00306 #endif

Generated on Fri Nov 6 00:18:46 2009 for synergy-plus by  doxygen 1.4.7