src/events/SDL_keyboard_c.h
branchSDL-1.3
changeset 1673 624e1412fbba
child 1674 7688a73b25b1
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/src/events/SDL_keyboard_c.h	Sat Jun 10 09:11:59 2006 +0000
     1.3 @@ -0,0 +1,77 @@
     1.4 +/*
     1.5 +    SDL - Simple DirectMedia Layer
     1.6 +    Copyright (C) 1997-2006 Sam Lantinga
     1.7 +
     1.8 +    This library is free software; you can redistribute it and/or
     1.9 +    modify it under the terms of the GNU Lesser General Public
    1.10 +    License as published by the Free Software Foundation; either
    1.11 +    version 2.1 of the License, or (at your option) any later version.
    1.12 +
    1.13 +    This library is distributed in the hope that it will be useful,
    1.14 +    but WITHOUT ANY WARRANTY; without even the implied warranty of
    1.15 +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    1.16 +    Lesser General Public License for more details.
    1.17 +
    1.18 +    You should have received a copy of the GNU Lesser General Public
    1.19 +    License along with this library; if not, write to the Free Software
    1.20 +    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
    1.21 +
    1.22 +    Sam Lantinga
    1.23 +    slouken@libsdl.org
    1.24 +*/
    1.25 +#include "SDL_config.h"
    1.26 +
    1.27 +#ifndef _SDL_keyboard_c_h
    1.28 +#define _SDL_keyboard_c_h
    1.29 +
    1.30 +typedef struct SDL_Keyboard SDL_Keyboard;
    1.31 +
    1.32 +struct SDL_Keyboard
    1.33 +{
    1.34 +    /* Free the keyboard when it's time */
    1.35 +    void (*FreeKeyboard) (SDL_Keyboard * keyboard);
    1.36 +
    1.37 +    SDLMod modstate;
    1.38 +    Uint8 keystate[SDLK_LAST];
    1.39 +
    1.40 +    struct
    1.41 +    {
    1.42 +        int firsttime;          /* if we check against the delay or repeat value */
    1.43 +        int delay;              /* the delay before we start repeating */
    1.44 +        int interval;           /* the delay between key repeat events */
    1.45 +        Uint32 timestamp;       /* the time the first keydown event occurred */
    1.46 +
    1.47 +        SDL_Event evt;          /* the event we are supposed to repeat */
    1.48 +    } keyrepeat;
    1.49 +
    1.50 +    void *driverdata;
    1.51 +};
    1.52 +
    1.53 +
    1.54 +/* Initialize the keyboard subsystem */
    1.55 +extern int SDL_KeyboardInit(void);
    1.56 +
    1.57 +/* Get the keyboard at an index */
    1.58 +extern SDL_Keyboard *SDL_GetKeyboard(int index);
    1.59 +
    1.60 +/* Add a keyboard, possibly reattaching at a particular index (or -1),
    1.61 +   returning the index of the keyboard, or -1 if there was an error.
    1.62 + */
    1.63 +extern int SDL_AddKeyboard(const SDL_Keyboard * keyboard, int index);
    1.64 +
    1.65 +/* Remove a keyboard at an index, clearing the slot for later */
    1.66 +extern void SDL_DelKeyboard(int index);
    1.67 +
    1.68 +/* Clear the state of a keyboard at an index */
    1.69 +extern void SDL_ResetKeyboard(int index);
    1.70 +
    1.71 +/* Send a keyboard event for a keyboard at an index */
    1.72 +extern int SDL_SendKeyboardKey(int index, Uint8 state,
    1.73 +                               const SDL_keysym * keysym);
    1.74 +
    1.75 +/* Shutdown the keyboard subsystem */
    1.76 +extern void SDL_KeyboardQuit(void);
    1.77 +
    1.78 +#endif /* _SDL_keyboard_c_h */
    1.79 +
    1.80 +/* vi: set ts=4 sw=4 expandtab: */