src/events/SDL_keyboard_c.h
changeset 2303 d87417504c75
parent 2300 c97ad1abe05b
child 2307 47f8a579cd9b
     1.1 --- a/src/events/SDL_keyboard_c.h	Mon Feb 04 17:25:33 2008 +0000
     1.2 +++ b/src/events/SDL_keyboard_c.h	Tue Feb 05 07:19:23 2008 +0000
     1.3 @@ -37,20 +37,12 @@
     1.4      /* Data common to all keyboards */
     1.5      SDL_WindowID focus;
     1.6      Uint16 modstate;
     1.7 -    Uint8 keystate[SDLK_LAST];
     1.8 +    Uint8 keystate[(SDL_NUM_SCANCODES + 7) / 8];
     1.9 +    SDLKey keymap[SDL_NUM_SCANCODES];
    1.10  
    1.11      void *driverdata;
    1.12  };
    1.13  
    1.14 -/* Used by the OS keyboard code to detect whether or not to do UNICODE */
    1.15 -#ifndef DEFAULT_UNICODE_TRANSLATION
    1.16 -#define DEFAULT_UNICODE_TRANSLATION 0   /* Default off because of overhead */
    1.17 -#endif
    1.18 -extern int SDL_TranslateUNICODE;
    1.19 -
    1.20 -/* convert UCS4 to utf8 */
    1.21 -extern char *SDL_Ucs4ToUtf8(Uint32 ch, char *dst);
    1.22 -
    1.23  /* Initialize the keyboard subsystem */
    1.24  extern int SDL_KeyboardInit(void);
    1.25  
    1.26 @@ -68,18 +60,23 @@
    1.27  /* Clear the state of a keyboard at an index */
    1.28  extern void SDL_ResetKeyboard(int index);
    1.29  
    1.30 +/* Get the default keymap */
    1.31 +extern void SDL_GetDefaultKeymap(SDLKey * keymap);
    1.32 +
    1.33 +/* Set the mapping of scancode to key codes for this keyboard */
    1.34 +extern void SDL_SetKeymap(int index, int start, SDLKey * keys, int length);
    1.35 +
    1.36  /* Set a platform-dependent key name, overriding the default platform-agnostic
    1.37     name. Encoded as UTF-8. The string is not copied, thus the pointer given to
    1.38     this function must stay valid forever (or at least until the call to
    1.39     VideoQuit()). */
    1.40 -extern void SDL_SetKeyName(SDLKey physicalKey, const char *name);
    1.41 +extern void SDL_SetScancodeName(SDL_scancode scancode, const char *name);
    1.42  
    1.43  /* Set the keyboard focus window */
    1.44  extern void SDL_SetKeyboardFocus(int index, SDL_WindowID windowID);
    1.45  
    1.46  /* Send a keyboard event for a keyboard at an index */
    1.47 -extern int SDL_SendKeyboardKey(int index, Uint8 state, Uint8 scancode,
    1.48 -                               SDLKey key);
    1.49 +extern int SDL_SendKeyboardKey(int index, Uint8 state, SDL_scancode scancode);
    1.50  
    1.51  /* Send keyboard text input for a keyboard at an index */
    1.52  extern int SDL_SendKeyboardText(int index, const char *text);