Mercurial > sdl-ios-xcode
comparison src/video/svga/SDL_svgaevents.c @ 1402:d910939febfa
Use consistent identifiers for the various platforms we support.
Make sure every source file includes SDL_config.h, so the proper system
headers are chosen.
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Tue, 21 Feb 2006 08:46:50 +0000 |
parents | c0a74f199ecf |
children | 782fd950bd46 c121d94672cb a1b03ba2fcd0 |
comparison
equal
deleted
inserted
replaced
1401:1819fd069e89 | 1402:d910939febfa |
---|---|
17 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | 17 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
18 | 18 |
19 Sam Lantinga | 19 Sam Lantinga |
20 slouken@libsdl.org | 20 slouken@libsdl.org |
21 */ | 21 */ |
22 #include "SDL_config.h" | |
22 | 23 |
23 /* Handle the event stream, converting X11 events into SDL events */ | 24 /* Handle the event stream, converting X11 events into SDL events */ |
24 | 25 |
25 #include <vga.h> | 26 #include <vga.h> |
26 #include <vgamouse.h> | 27 #include <vgamouse.h> |
27 #include <vgakeyboard.h> | 28 #include <vgakeyboard.h> |
28 #if defined(linux) | 29 #if defined(__LINUX__) |
29 #include <linux/kd.h> | 30 #include <linux/kd.h> |
30 #include <linux/keyboard.h> | 31 #include <linux/keyboard.h> |
31 #elif defined(__FreeBSD__) | 32 #elif defined(__FREEBSD__) |
32 #include <sys/kbio.h> | 33 #include <sys/kbio.h> |
33 #else | 34 #else |
34 #error You must choose your operating system here | 35 #error You must choose your operating system here |
35 #endif | 36 #endif |
36 | 37 |
41 | 42 |
42 /* The translation tables from a console scancode to a SDL keysym */ | 43 /* The translation tables from a console scancode to a SDL keysym */ |
43 #if defined(linux) | 44 #if defined(linux) |
44 #define NUM_VGAKEYMAPS (1<<KG_CAPSSHIFT) | 45 #define NUM_VGAKEYMAPS (1<<KG_CAPSSHIFT) |
45 static Uint16 vga_keymap[NUM_VGAKEYMAPS][NR_KEYS]; | 46 static Uint16 vga_keymap[NUM_VGAKEYMAPS][NR_KEYS]; |
46 #elif defined(__FreeBSD__) | 47 #elif defined(__FREEBSD__) |
47 /* FIXME: Free the keymap when we shut down the video mode */ | 48 /* FIXME: Free the keymap when we shut down the video mode */ |
48 static keymap_t *vga_keymap = NULL; | 49 static keymap_t *vga_keymap = NULL; |
49 #else | 50 #else |
50 #error You must choose your operating system here | 51 #error You must choose your operating system here |
51 #endif | 52 #endif |
124 } | 125 } |
125 } | 126 } |
126 } | 127 } |
127 return(0); | 128 return(0); |
128 } | 129 } |
129 #elif defined(__FreeBSD__) | 130 #elif defined(__FREEBSD__) |
130 int SVGA_initkeymaps(int fd) | 131 int SVGA_initkeymaps(int fd) |
131 { | 132 { |
132 vga_keymap = SDL_malloc(sizeof(keymap_t)); | 133 vga_keymap = SDL_malloc(sizeof(keymap_t)); |
133 if ( ! vga_keymap ) { | 134 if ( ! vga_keymap ) { |
134 SDL_OutOfMemory(); | 135 SDL_OutOfMemory(); |
372 keysym->unicode = KVAL(vga_keymap[map][scancode]); | 373 keysym->unicode = KVAL(vga_keymap[map][scancode]); |
373 } | 374 } |
374 } | 375 } |
375 return(keysym); | 376 return(keysym); |
376 } | 377 } |
377 #elif defined(__FreeBSD__) | 378 #elif defined(__FREEBSD__) |
378 static SDL_keysym *TranslateKey(int scancode, SDL_keysym *keysym) | 379 static SDL_keysym *TranslateKey(int scancode, SDL_keysym *keysym) |
379 { | 380 { |
380 /* Set the keysym information */ | 381 /* Set the keysym information */ |
381 keysym->scancode = scancode; | 382 keysym->scancode = scancode; |
382 keysym->sym = keymap[scancode]; | 383 keysym->sym = keymap[scancode]; |