00001 /* 00002 SDL - Simple DirectMedia Layer 00003 Copyright (C) 1997-2009 Sam Lantinga 00004 00005 This library is free software; you can redistribute it and/or 00006 modify it under the terms of the GNU Lesser General Public 00007 License as published by the Free Software Foundation; either 00008 version 2.1 of the License, or (at your option) any later version. 00009 00010 This library is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 Lesser General Public License for more details. 00014 00015 You should have received a copy of the GNU Lesser General Public 00016 License along with this library; if not, write to the Free Software 00017 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 00018 00019 Sam Lantinga 00020 slouken@libsdl.org 00021 */ 00022 00029 #ifndef _SDL_keyboard_h 00030 #define _SDL_keyboard_h 00031 00032 #include "SDL_stdinc.h" 00033 #include "SDL_error.h" 00034 #include "SDL_keysym.h" 00035 00036 #include "begin_code.h" 00037 /* Set up for C function definitions, even when using C++ */ 00038 #ifdef __cplusplus 00039 /* *INDENT-OFF* */ 00040 extern "C" { 00041 /* *INDENT-ON* */ 00042 #endif 00043 00049 typedef struct SDL_keysym 00050 { 00051 SDL_scancode scancode; 00052 SDLKey sym; 00053 Uint16 mod; 00054 Uint32 unicode; 00055 } SDL_keysym; 00056 00057 /* Function prototypes */ 00058 00066 extern DECLSPEC int SDLCALL SDL_GetNumKeyboards(void); 00067 00079 extern DECLSPEC int SDLCALL SDL_SelectKeyboard(int index); 00080 00094 extern DECLSPEC Uint8 *SDLCALL SDL_GetKeyboardState(int *numkeys); 00095 00101 extern DECLSPEC SDLMod SDLCALL SDL_GetModState(void); 00102 00110 extern DECLSPEC void SDLCALL SDL_SetModState(SDLMod modstate); 00111 00121 extern DECLSPEC SDLKey SDLCALL SDL_GetKeyFromScancode(SDL_scancode scancode); 00122 00132 extern DECLSPEC SDL_scancode SDLCALL SDL_GetScancodeFromKey(SDLKey key); 00133 00143 extern DECLSPEC const char *SDLCALL SDL_GetScancodeName(SDL_scancode 00144 scancode); 00145 00155 extern DECLSPEC const char *SDLCALL SDL_GetKeyName(SDLKey key); 00156 00165 extern DECLSPEC void SDLCALL SDL_StartTextInput(void); 00166 00174 extern DECLSPEC void SDLCALL SDL_StopTextInput(void); 00175 00183 extern DECLSPEC void SDLCALL SDL_SetTextInputRect(SDL_Rect *rect); 00184 00185 00186 /* Ends C function definitions when using C++ */ 00187 #ifdef __cplusplus 00188 /* *INDENT-OFF* */ 00189 } 00190 /* *INDENT-ON* */ 00191 #endif 00192 #include "close_code.h" 00193 00194 #endif /* _SDL_keyboard_h */ 00195 00196 /* vi: set ts=4 sw=4 expandtab: */