Source

pysdl-cffi / sdl_defs / SDL_keycode.h

Full commit
/*
  Simple DirectMedia Layer
  Copyright (C) 1997-2012 Sam Lantinga <slouken@libsdl.org>

  This software is provided 'as-is', without any express or implied
  warranty.  In no event will the authors be held liable for any damages
  arising from the use of this software.

  Permission is granted to anyone to use this software for any purpose,
  including commercial applications, and to alter it and redistribute it
  freely, subject to the following restrictions:

  1. The origin of this software must not be misrepresented; you must not
     claim that you wrote the original software. If you use this software
     in a product, an acknowledgment in the product documentation would be
     appreciated but is not required.
  2. Altered source versions must be plainly marked as such, and must not be
     misrepresented as being the original software.
  3. This notice may not be removed or altered from any source distribution.
*/

/**
 *  \file SDL_keycode.h
 *  
 *  Defines constants which identify keyboard keys and modifiers.
 */

#ifndef _SDL_keycode_h
#define _SDL_keycode_h

#include "SDL_stdinc.h"
#include "SDL_scancode.h"

/**
 *  \brief The SDL virtual key representation.
 *  
 *  Values of this type are used to represent keyboard keys using the current
 *  layout of the keyboard.  These values include Unicode values representing
 *  the unmodified character that would be generated by pressing the key, or
 *  an SDLK_* constant for those keys that do not generate characters.
 */
typedef Sint32 SDL_Keycode;

#define SDLK_SCANCODE_MASK (1<<30)
#define SDL_SCANCODE_TO_KEYCODE(X)	(X | SDLK_SCANCODE_MASK)

#define SDLK_UNKNOWN ...

#define SDLK_RETURN ...
#define SDLK_ESCAPE ...
#define SDLK_BACKSPACE ...
#define SDLK_TAB ...
#define SDLK_SPACE ...
#define SDLK_EXCLAIM ...
#define SDLK_QUOTEDBL ...
#define SDLK_HASH ...
#define SDLK_PERCENT ...
#define SDLK_DOLLAR ...
#define SDLK_AMPERSAND ...
#define SDLK_QUOTE ...
#define SDLK_LEFTPAREN ...
#define SDLK_RIGHTPAREN ...
#define SDLK_ASTERISK ...
#define SDLK_PLUS ...
#define SDLK_COMMA ...
#define SDLK_MINUS ...
#define SDLK_PERIOD ...
#define SDLK_SLASH ...
#define SDLK_0 ...
#define SDLK_1 ...
#define SDLK_2 ...
#define SDLK_3 ...
#define SDLK_4 ...
#define SDLK_5 ...
#define SDLK_6 ...
#define SDLK_7 ...
#define SDLK_8 ...
#define SDLK_9 ...
#define SDLK_COLON ...
#define SDLK_SEMICOLON ...
#define SDLK_LESS ...
#define SDLK_EQUALS ...
#define SDLK_GREATER ...
#define SDLK_QUESTION ...
#define SDLK_AT ...
/* 
   Skip uppercase letters
 */
#define SDLK_LEFTBRACKET ...
#define SDLK_BACKSLASH ...
#define SDLK_RIGHTBRACKET ...
#define SDLK_CARET ...
#define SDLK_UNDERSCORE ...
#define SDLK_BACKQUOTE ...
#define SDLK_a ...
#define SDLK_b ...
#define SDLK_c ...
#define SDLK_d ...
#define SDLK_e ...
#define SDLK_f ...
#define SDLK_g ...
#define SDLK_h ...
#define SDLK_i ...
#define SDLK_j ...
#define SDLK_k ...
#define SDLK_l ...
#define SDLK_m ...
#define SDLK_n ...
#define SDLK_o ...
#define SDLK_p ...
#define SDLK_q ...
#define SDLK_r ...
#define SDLK_s ...
#define SDLK_t ...
#define SDLK_u ...
#define SDLK_v ...
#define SDLK_w ...
#define SDLK_x ...
#define SDLK_y ...
#define SDLK_z ...

#define SDLK_CAPSLOCK ...

#define SDLK_F1 ...
#define SDLK_F2 ...
#define SDLK_F3 ...
#define SDLK_F4 ...
#define SDLK_F5 ...
#define SDLK_F6 ...
#define SDLK_F7 ...
#define SDLK_F8 ...
#define SDLK_F9 ...
#define SDLK_F10 ...
#define SDLK_F11 ...
#define SDLK_F12 ...

#define SDLK_PRINTSCREEN ...
#define SDLK_SCROLLLOCK ...
#define SDLK_PAUSE ...
#define SDLK_INSERT ...
#define SDLK_HOME ...
#define SDLK_PAGEUP ...
#define SDLK_DELETE ...
#define SDLK_END ...
#define SDLK_PAGEDOWN ...
#define SDLK_RIGHT ...
#define SDLK_LEFT ...
#define SDLK_DOWN ...
#define SDLK_UP ...

#define SDLK_NUMLOCKCLEAR ...
#define SDLK_KP_DIVIDE ...
#define SDLK_KP_MULTIPLY ...
#define SDLK_KP_MINUS ...
#define SDLK_KP_PLUS ...
#define SDLK_KP_ENTER ...
#define SDLK_KP_1 ...
#define SDLK_KP_2 ...
#define SDLK_KP_3 ...
#define SDLK_KP_4 ...
#define SDLK_KP_5 ...
#define SDLK_KP_6 ...
#define SDLK_KP_7 ...
#define SDLK_KP_8 ...
#define SDLK_KP_9 ...
#define SDLK_KP_0 ...
#define SDLK_KP_PERIOD ...

#define SDLK_APPLICATION ...
#define SDLK_POWER ...
#define SDLK_KP_EQUALS ...
#define SDLK_F13 ...
#define SDLK_F14 ...
#define SDLK_F15 ...
#define SDLK_F16 ...
#define SDLK_F17 ...
#define SDLK_F18 ...
#define SDLK_F19 ...
#define SDLK_F20 ...
#define SDLK_F21 ...
#define SDLK_F22 ...
#define SDLK_F23 ...
#define SDLK_F24 ...
#define SDLK_EXECUTE ...
#define SDLK_HELP ...
#define SDLK_MENU ...
#define SDLK_SELECT ...
#define SDLK_STOP ...
#define SDLK_AGAIN ...
#define SDLK_UNDO ...
#define SDLK_CUT ...
#define SDLK_COPY ...
#define SDLK_PASTE ...
#define SDLK_FIND ...
#define SDLK_MUTE ...
#define SDLK_VOLUMEUP ...
#define SDLK_VOLUMEDOWN ...
#define SDLK_KP_COMMA ...
#define SDLK_KP_EQUALSAS400 ...

#define SDLK_ALTERASE ...
#define SDLK_SYSREQ ...
#define SDLK_CANCEL ...
#define SDLK_CLEAR ...
#define SDLK_PRIOR ...
#define SDLK_RETURN2 ...
#define SDLK_SEPARATOR ...
#define SDLK_OUT ...
#define SDLK_OPER ...
#define SDLK_CLEARAGAIN ...
#define SDLK_CRSEL ...
#define SDLK_EXSEL ...

#define SDLK_KP_00 ...
#define SDLK_KP_000 ...
#define SDLK_THOUSANDSSEPARATOR ...
#define SDLK_DECIMALSEPARATOR ...
#define SDLK_CURRENCYUNIT ...
#define SDLK_CURRENCYSUBUNIT ...
#define SDLK_KP_LEFTPAREN ...
#define SDLK_KP_RIGHTPAREN ...
#define SDLK_KP_LEFTBRACE ...
#define SDLK_KP_RIGHTBRACE ...
#define SDLK_KP_TAB ...
#define SDLK_KP_BACKSPACE ...
#define SDLK_KP_A ...
#define SDLK_KP_B ...
#define SDLK_KP_C ...
#define SDLK_KP_D ...
#define SDLK_KP_E ...
#define SDLK_KP_F ...
#define SDLK_KP_XOR ...
#define SDLK_KP_POWER ...
#define SDLK_KP_PERCENT ...
#define SDLK_KP_LESS ...
#define SDLK_KP_GREATER ...
#define SDLK_KP_AMPERSAND ...
#define SDLK_KP_DBLAMPERSAND ...
#define SDLK_KP_VERTICALBAR ...
#define SDLK_KP_DBLVERTICALBAR ...
#define SDLK_KP_COLON ...
#define SDLK_KP_HASH ...
#define SDLK_KP_SPACE ...
#define SDLK_KP_AT ...
#define SDLK_KP_EXCLAM ...
#define SDLK_KP_MEMSTORE ...
#define SDLK_KP_MEMRECALL ...
#define SDLK_KP_MEMCLEAR ...
#define SDLK_KP_MEMADD ...
#define SDLK_KP_MEMSUBTRACT ...
#define SDLK_KP_MEMMULTIPLY ...
#define SDLK_KP_MEMDIVIDE ...
#define SDLK_KP_PLUSMINUS ...
#define SDLK_KP_CLEAR ...
#define SDLK_KP_CLEARENTRY ...
#define SDLK_KP_BINARY ...
#define SDLK_KP_OCTAL ...
#define SDLK_KP_DECIMAL ...
#define SDLK_KP_HEXADECIMAL ...

#define SDLK_LCTRL ...
#define SDLK_LSHIFT ...
#define SDLK_LALT ...
#define SDLK_LGUI ...
#define SDLK_RCTRL ...
#define SDLK_RSHIFT ...
#define SDLK_RALT ...
#define SDLK_RGUI ...

#define SDLK_MODE ...

#define SDLK_AUDIONEXT ...
#define SDLK_AUDIOPREV ...
#define SDLK_AUDIOSTOP ...
#define SDLK_AUDIOPLAY ...
#define SDLK_AUDIOMUTE ...
#define SDLK_MEDIASELECT ...
#define SDLK_WWW ...
#define SDLK_MAIL ...
#define SDLK_CALCULATOR ...
#define SDLK_COMPUTER ...
#define SDLK_AC_SEARCH ...
#define SDLK_AC_HOME ...
#define SDLK_AC_BACK ...
#define SDLK_AC_FORWARD ...
#define SDLK_AC_STOP ...
#define SDLK_AC_REFRESH ...
#define SDLK_AC_BOOKMARKS ...

#define SDLK_BRIGHTNESSDOWN ...
#define SDLK_BRIGHTNESSUP ...
#define SDLK_DISPLAYSWITCH ...
#define SDLK_KBDILLUMTOGGLE ...
#define SDLK_KBDILLUMDOWN ...
#define SDLK_KBDILLUMUP ...
#define SDLK_EJECT ...
#define SDLK_SLEEP ...

/**
 * \brief Enumeration of valid key mods (possibly OR'd together).
 */
typedef enum
{
    KMOD_NONE = 0x0000,
    KMOD_LSHIFT = 0x0001,
    KMOD_RSHIFT = 0x0002,
    KMOD_LCTRL = 0x0040,
    KMOD_RCTRL = 0x0080,
    KMOD_LALT = 0x0100,
    KMOD_RALT = 0x0200,
    KMOD_LGUI = 0x0400,
    KMOD_RGUI = 0x0800,
    KMOD_NUM = 0x1000,
    KMOD_CAPS = 0x2000,
    KMOD_MODE = 0x4000,
    KMOD_RESERVED = 0x8000
} SDL_Keymod;

#define KMOD_CTRL	(KMOD_LCTRL|KMOD_RCTRL)
#define KMOD_SHIFT	(KMOD_LSHIFT|KMOD_RSHIFT)
#define KMOD_ALT	(KMOD_LALT|KMOD_RALT)
#define KMOD_GUI	(KMOD_LGUI|KMOD_RGUI)

#endif /* _SDL_keycode_h */

/* vi: set ts=4 sw=4 expandtab: */