1 /* 2 SDL - Simple DirectMedia Layer 3 Copyright (C) 1997-2012 Sam Lantinga 4 5 This library is free software; you can redistribute it and/or 6 modify it under the terms of the GNU Lesser General Public 7 License as published by the Free Software Foundation; either 8 version 2.1 of the License, or (at your option) any later version. 9 10 This library is distributed in the hope that it will be useful, 11 but WITHOUT ANY WARRANTY; without even the implied warranty of 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 Lesser General Public License for more details. 14 15 You should have received a copy of the GNU Lesser General Public 16 License along with this library; if not, write to the Free Software 17 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 19 Sam Lantinga 20 slouken (at) libsdl.org 21 */ 22 #include "SDL_config.h" 23 24 #include "SDL_vglvideo.h" 25 26 /* Variables and functions exported by SDL_sysevents.c to other parts 27 of the native video subsystem (SDL_sysvideo.c) 28 */ 29 extern int VGL_initkeymaps(int fd); 30 extern int VGL_initmouse(int fd); 31 extern void VGL_keyboardcallback(int scancode, int pressed); 32 33 extern void VGL_InitOSKeymap(_THIS); 34 extern void VGL_PumpEvents(_THIS); 35 36 /* Mouse buttons */ 37 #define MOUSE_LEFTBUTTON 0x01 38 #define MOUSE_MIDDLEBUTTON 0x02 39 #define MOUSE_RIGHTBUTTON 0x04 40 41 /* Scancodes */ 42 #define SCANCODE_ESCAPE 1 43 #define SCANCODE_1 2 44 #define SCANCODE_2 3 45 #define SCANCODE_3 4 46 #define SCANCODE_4 5 47 #define SCANCODE_5 6 48 #define SCANCODE_6 7 49 #define SCANCODE_7 8 50 #define SCANCODE_8 9 51 #define SCANCODE_9 10 52 #define SCANCODE_0 11 53 #define SCANCODE_MINUS 12 54 #define SCANCODE_EQUAL 13 55 #define SCANCODE_BACKSPACE 14 56 #define SCANCODE_TAB 15 57 #define SCANCODE_Q 16 58 #define SCANCODE_W 17 59 #define SCANCODE_E 18 60 #define SCANCODE_R 19 61 #define SCANCODE_T 20 62 #define SCANCODE_Y 21 63 #define SCANCODE_U 22 64 #define SCANCODE_I 23 65 #define SCANCODE_O 24 66 #define SCANCODE_P 25 67 #define SCANCODE_BRACKET_LEFT 26 68 #define SCANCODE_BRACKET_RIGHT 27 69 #define SCANCODE_ENTER 28 70 #define SCANCODE_LEFTCONTROL 29 71 #define SCANCODE_A 30 72 #define SCANCODE_S 31 73 #define SCANCODE_D 32 74 #define SCANCODE_F 33 75 #define SCANCODE_G 34 76 #define SCANCODE_H 35 77 #define SCANCODE_J 36 78 #define SCANCODE_K 37 79 #define SCANCODE_L 38 80 #define SCANCODE_SEMICOLON 39 81 #define SCANCODE_APOSTROPHE 40 82 #define SCANCODE_GRAVE 41 83 #define SCANCODE_LEFTSHIFT 42 84 #define SCANCODE_BACKSLASH 43 85 #define SCANCODE_Z 44 86 #define SCANCODE_X 45 87 #define SCANCODE_C 46 88 #define SCANCODE_V 47 89 #define SCANCODE_B 48 90 #define SCANCODE_N 49 91 #define SCANCODE_M 50 92 #define SCANCODE_COMMA 51 93 #define SCANCODE_PERIOD 52 94 #define SCANCODE_SLASH 53 95 #define SCANCODE_RIGHTSHIFT 54 96 #define SCANCODE_KEYPADMULTIPLY 55 97 #define SCANCODE_LEFTALT 56 98 #define SCANCODE_SPACE 57 99 #define SCANCODE_CAPSLOCK 58 100 #define SCANCODE_F1 59 101 #define SCANCODE_F2 60 102 #define SCANCODE_F3 61 103 #define SCANCODE_F4 62 104 #define SCANCODE_F5 63 105 #define SCANCODE_F6 64 106 #define SCANCODE_F7 65 107 #define SCANCODE_F8 66 108 #define SCANCODE_F9 67 109 #define SCANCODE_F10 68 110 #define SCANCODE_NUMLOCK 69 111 #define SCANCODE_SCROLLLOCK 70 112 #define SCANCODE_KEYPAD7 71 113 #define SCANCODE_CURSORUPLEFT 71 114 #define SCANCODE_KEYPAD8 72 115 #define SCANCODE_CURSORUP 72 116 #define SCANCODE_KEYPAD9 73 117 #define SCANCODE_CURSORUPRIGHT 73 118 #define SCANCODE_KEYPADMINUS 74 119 #define SCANCODE_KEYPAD4 75 120 #define SCANCODE_CURSORLEFT 75 121 #define SCANCODE_KEYPAD5 76 122 #define SCANCODE_KEYPAD6 77 123 #define SCANCODE_CURSORRIGHT 77 124 #define SCANCODE_KEYPADPLUS 78 125 #define SCANCODE_KEYPAD1 79 126 #define SCANCODE_CURSORDOWNLEFT 79 127 #define SCANCODE_KEYPAD2 80 128 #define SCANCODE_CURSORDOWN 80 129 #define SCANCODE_KEYPAD3 81 130 #define SCANCODE_CURSORDOWNRIGHT 81 131 #define SCANCODE_KEYPAD0 82 132 #define SCANCODE_KEYPADPERIOD 83 133 #define SCANCODE_LESS 86 134 #define SCANCODE_F11 87 135 #define SCANCODE_F12 88 136 #define SCANCODE_KEYPADENTER 89 137 #define SCANCODE_RIGHTCONTROL 90 138 #define SCANCODE_CONTROL 107 139 #define SCANCODE_KEYPADDIVIDE 91 140 #define SCANCODE_PRINTSCREEN 92 141 #define SCANCODE_RIGHTALT 93 142 #define SCANCODE_BREAK 104 /* Beware: is 119 */ 143 #define SCANCODE_BREAK_ALTERNATIVE 104 /* on some keyboards! */ 144 #define SCANCODE_HOME 94 145 #define SCANCODE_CURSORBLOCKUP 95 /* Cursor key block */ 146 #define SCANCODE_PAGEUP 96 147 #define SCANCODE_CURSORBLOCKLEFT 97 /* Cursor key block */ 148 #define SCANCODE_CURSORBLOCKRIGHT 98 /* Cursor key block */ 149 #define SCANCODE_END 99 150 #define SCANCODE_CURSORBLOCKDOWN 100 /* Cursor key block */ 151 #define SCANCODE_PAGEDOWN 101 152 #define SCANCODE_INSERT 102 153 #define SCANCODE_REMOVE 103 154 #define SCANCODE_RIGHTWIN 106 155 #define SCANCODE_LEFTWIN 105 156