src/events/SDL_keyboard_c.h
author Sam Lantinga <slouken@libsdl.org>
Tue, 20 Jul 2010 23:25:24 -0700
changeset 4560 95352c671a6e
parent 4465 3e69e077cb95
child 4565 e2d46c5c7483
permissions -rw-r--r--
Added support for keyboard repeat (only tested on Windows so far)
     1 /*
     2     SDL - Simple DirectMedia Layer
     3     Copyright (C) 1997-2010 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@libsdl.org
    21 */
    22 #include "SDL_config.h"
    23 
    24 #ifndef _SDL_keyboard_c_h
    25 #define _SDL_keyboard_c_h
    26 
    27 #include "SDL_keysym.h"
    28 #include "SDL_events.h"
    29 
    30 /* Initialize the keyboard subsystem */
    31 extern int SDL_KeyboardInit(void);
    32 
    33 /* Clear the state of the keyboard */
    34 extern void SDL_ResetKeyboard(void);
    35 
    36 /* Get the default keymap */
    37 extern void SDL_GetDefaultKeymap(SDLKey * keymap);
    38 
    39 /* Set the mapping of scancode to key codes */
    40 extern void SDL_SetKeymap(int start, SDLKey * keys, int length);
    41 
    42 /* Set a platform-dependent key name, overriding the default platform-agnostic
    43    name. Encoded as UTF-8. The string is not copied, thus the pointer given to
    44    this function must stay valid forever (or at least until the call to
    45    VideoQuit()). */
    46 extern void SDL_SetScancodeName(SDL_scancode scancode, const char *name);
    47 
    48 /* Set the keyboard focus window */
    49 extern void SDL_SetKeyboardFocus(SDL_Window * window);
    50 
    51 /* Send a keyboard key event */
    52 extern int SDL_SendKeyboardKey(Uint8 state, SDL_scancode scancode, SDL_bool repeat);
    53 
    54 /* Send keyboard text input */
    55 extern int SDL_SendKeyboardText(const char *text);
    56 
    57 /* Send editing text for selected range from start to end */
    58 extern int SDL_SendEditingText(const char *text, int start, int end);
    59 
    60 /* Shutdown the keyboard subsystem */
    61 extern void SDL_KeyboardQuit(void);
    62 
    63 #endif /* _SDL_keyboard_c_h */
    64 
    65 /* vi: set ts=4 sw=4 expandtab: */