Mercurial > sdl-ios-xcode
comparison src/events/SDL_keyboard.c @ 1330:450721ad5436
It's now possible to build SDL without any C runtime at all on Windows,
using Visual C++ 2005
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Mon, 06 Feb 2006 08:28:51 +0000 |
parents | d12a63a8d95a |
children | 3692456e7b0f |
comparison
equal
deleted
inserted
replaced
1329:bc67bbf87818 | 1330:450721ad5436 |
---|---|
20 slouken@libsdl.org | 20 slouken@libsdl.org |
21 */ | 21 */ |
22 | 22 |
23 /* General keyboard handling code for SDL */ | 23 /* General keyboard handling code for SDL */ |
24 | 24 |
25 #include <stdio.h> | |
26 #include <ctype.h> | |
27 #include <stdlib.h> | |
28 #include <string.h> | |
29 | |
30 #include "SDL_error.h" | 25 #include "SDL_error.h" |
31 #include "SDL_events.h" | 26 #include "SDL_events.h" |
32 #include "SDL_timer.h" | 27 #include "SDL_timer.h" |
28 #include "SDL_string.h" | |
33 #include "SDL_events_c.h" | 29 #include "SDL_events_c.h" |
34 #include "SDL_sysevents.h" | 30 #include "SDL_sysevents.h" |
35 | 31 |
36 | 32 |
37 /* Global keystate information */ | 33 /* Global keystate information */ |
56 /* Public functions */ | 52 /* Public functions */ |
57 int SDL_KeyboardInit(void) | 53 int SDL_KeyboardInit(void) |
58 { | 54 { |
59 SDL_VideoDevice *video = current_video; | 55 SDL_VideoDevice *video = current_video; |
60 SDL_VideoDevice *this = current_video; | 56 SDL_VideoDevice *this = current_video; |
61 Uint16 i; | |
62 | 57 |
63 /* Set default mode of UNICODE translation */ | 58 /* Set default mode of UNICODE translation */ |
64 SDL_EnableUNICODE(DEFAULT_UNICODE_TRANSLATION); | 59 SDL_EnableUNICODE(DEFAULT_UNICODE_TRANSLATION); |
65 | 60 |
66 /* Initialize the tables */ | 61 /* Initialize the tables */ |
67 SDL_ModState = KMOD_NONE; | 62 SDL_ModState = KMOD_NONE; |
68 for ( i=0; i<SDL_TABLESIZE(keynames); ++i ) | 63 memset(keynames, 0, sizeof(keynames)); |
69 keynames[i] = NULL; | 64 memset(SDL_KeyState, 0, sizeof(SDL_KeyState)); |
70 for ( i=0; i<SDL_TABLESIZE(SDL_KeyState); ++i ) | |
71 SDL_KeyState[i] = SDL_RELEASED; | |
72 video->InitOSKeymap(this); | 65 video->InitOSKeymap(this); |
73 | 66 |
74 SDL_EnableKeyRepeat(0, 0); | 67 SDL_EnableKeyRepeat(0, 0); |
75 | 68 |
76 /* Fill in the blanks in keynames */ | 69 /* Fill in the blanks in keynames */ |