想用SDL的按键检测,网上找了半天都没找到SDL中按键的值的定义,索性自己去看头文件,在SDL_keysym.h中。

  其实很多键的值和它们的ASCII码是相同的。

  其他更多的用法,可以参考这篇博客:http://blog.chinaunix.net/uid-28482676-id-3444915.html/

typedef enum {
/** @name ASCII mapped keysyms
* The keyboard syms have been cleverly chosen to map to ASCII
*/
/*@{*/
SDLK_UNKNOWN = ,
SDLK_FIRST = ,
SDLK_BACKSPACE = ,
SDLK_TAB = ,
SDLK_CLEAR = ,
SDLK_RETURN = ,
SDLK_PAUSE = ,
SDLK_ESCAPE = ,
SDLK_SPACE = ,
SDLK_EXCLAIM = ,
SDLK_QUOTEDBL = ,
SDLK_HASH = ,
SDLK_DOLLAR = ,
SDLK_AMPERSAND = ,
SDLK_QUOTE = ,
SDLK_LEFTPAREN = ,
SDLK_RIGHTPAREN = ,
SDLK_ASTERISK = ,
SDLK_PLUS = ,
SDLK_COMMA = ,
SDLK_MINUS = ,
SDLK_PERIOD = ,
SDLK_SLASH = ,
SDLK_0 = ,
SDLK_1 = ,
SDLK_2 = ,
SDLK_3 = ,
SDLK_4 = ,
SDLK_5 = ,
SDLK_6 = ,
SDLK_7 = ,
SDLK_8 = ,
SDLK_9 = ,
SDLK_COLON = ,
SDLK_SEMICOLON = ,
SDLK_LESS = ,
SDLK_EQUALS = ,
SDLK_GREATER = ,
SDLK_QUESTION = ,
SDLK_AT = ,
/*
Skip uppercase letters
*/
SDLK_LEFTBRACKET = ,
SDLK_BACKSLASH = ,
SDLK_RIGHTBRACKET = ,
SDLK_CARET = ,
SDLK_UNDERSCORE = ,
SDLK_BACKQUOTE = ,
SDLK_a = ,
SDLK_b = ,
SDLK_c = ,
SDLK_d = ,
SDLK_e = ,
SDLK_f = ,
SDLK_g = ,
SDLK_h = ,
SDLK_i = ,
SDLK_j = ,
SDLK_k = ,
SDLK_l = ,
SDLK_m = ,
SDLK_n = ,
SDLK_o = ,
SDLK_p = ,
SDLK_q = ,
SDLK_r = ,
SDLK_s = ,
SDLK_t = ,
SDLK_u = ,
SDLK_v = ,
SDLK_w = ,
SDLK_x = ,
SDLK_y = ,
SDLK_z = ,
SDLK_DELETE = ,
/* End of ASCII mapped keysyms */
/*@}*/ /** @name International keyboard syms */
/*@{*/
SDLK_WORLD_0 = , /* 0xA0 */
SDLK_WORLD_1 = ,
SDLK_WORLD_2 = ,
SDLK_WORLD_3 = ,
SDLK_WORLD_4 = ,
SDLK_WORLD_5 = ,
SDLK_WORLD_6 = ,
SDLK_WORLD_7 = ,
SDLK_WORLD_8 = ,
SDLK_WORLD_9 = ,
SDLK_WORLD_10 = ,
SDLK_WORLD_11 = ,
SDLK_WORLD_12 = ,
SDLK_WORLD_13 = ,
SDLK_WORLD_14 = ,
SDLK_WORLD_15 = ,
SDLK_WORLD_16 = ,
SDLK_WORLD_17 = ,
SDLK_WORLD_18 = ,
SDLK_WORLD_19 = ,
SDLK_WORLD_20 = ,
SDLK_WORLD_21 = ,
SDLK_WORLD_22 = ,
SDLK_WORLD_23 = ,
SDLK_WORLD_24 = ,
SDLK_WORLD_25 = ,
SDLK_WORLD_26 = ,
SDLK_WORLD_27 = ,
SDLK_WORLD_28 = ,
SDLK_WORLD_29 = ,
SDLK_WORLD_30 = ,
SDLK_WORLD_31 = ,
SDLK_WORLD_32 = ,
SDLK_WORLD_33 = ,
SDLK_WORLD_34 = ,
SDLK_WORLD_35 = ,
SDLK_WORLD_36 = ,
SDLK_WORLD_37 = ,
SDLK_WORLD_38 = ,
SDLK_WORLD_39 = ,
SDLK_WORLD_40 = ,
SDLK_WORLD_41 = ,
SDLK_WORLD_42 = ,
SDLK_WORLD_43 = ,
SDLK_WORLD_44 = ,
SDLK_WORLD_45 = ,
SDLK_WORLD_46 = ,
SDLK_WORLD_47 = ,
SDLK_WORLD_48 = ,
SDLK_WORLD_49 = ,
SDLK_WORLD_50 = ,
SDLK_WORLD_51 = ,
SDLK_WORLD_52 = ,
SDLK_WORLD_53 = ,
SDLK_WORLD_54 = ,
SDLK_WORLD_55 = ,
SDLK_WORLD_56 = ,
SDLK_WORLD_57 = ,
SDLK_WORLD_58 = ,
SDLK_WORLD_59 = ,
SDLK_WORLD_60 = ,
SDLK_WORLD_61 = ,
SDLK_WORLD_62 = ,
SDLK_WORLD_63 = ,
SDLK_WORLD_64 = ,
SDLK_WORLD_65 = ,
SDLK_WORLD_66 = ,
SDLK_WORLD_67 = ,
SDLK_WORLD_68 = ,
SDLK_WORLD_69 = ,
SDLK_WORLD_70 = ,
SDLK_WORLD_71 = ,
SDLK_WORLD_72 = ,
SDLK_WORLD_73 = ,
SDLK_WORLD_74 = ,
SDLK_WORLD_75 = ,
SDLK_WORLD_76 = ,
SDLK_WORLD_77 = ,
SDLK_WORLD_78 = ,
SDLK_WORLD_79 = ,
SDLK_WORLD_80 = ,
SDLK_WORLD_81 = ,
SDLK_WORLD_82 = ,
SDLK_WORLD_83 = ,
SDLK_WORLD_84 = ,
SDLK_WORLD_85 = ,
SDLK_WORLD_86 = ,
SDLK_WORLD_87 = ,
SDLK_WORLD_88 = ,
SDLK_WORLD_89 = ,
SDLK_WORLD_90 = ,
SDLK_WORLD_91 = ,
SDLK_WORLD_92 = ,
SDLK_WORLD_93 = ,
SDLK_WORLD_94 = ,
SDLK_WORLD_95 = , /* 0xFF */
/*@}*/ /** @name Numeric keypad */
/*@{*/
SDLK_KP0 = ,
SDLK_KP1 = ,
SDLK_KP2 = ,
SDLK_KP3 = ,
SDLK_KP4 = ,
SDLK_KP5 = ,
SDLK_KP6 = ,
SDLK_KP7 = ,
SDLK_KP8 = ,
SDLK_KP9 = ,
SDLK_KP_PERIOD = ,
SDLK_KP_DIVIDE = ,
SDLK_KP_MULTIPLY = ,
SDLK_KP_MINUS = ,
SDLK_KP_PLUS = ,
SDLK_KP_ENTER = ,
SDLK_KP_EQUALS = ,
/*@}*/ /** @name Arrows + Home/End pad */
/*@{*/
SDLK_UP = ,
SDLK_DOWN = ,
SDLK_RIGHT = ,
SDLK_LEFT = ,
SDLK_INSERT = ,
SDLK_HOME = ,
SDLK_END = ,
SDLK_PAGEUP = ,
SDLK_PAGEDOWN = ,
/*@}*/ /** @name Function keys */
/*@{*/
SDLK_F1 = ,
SDLK_F2 = ,
SDLK_F3 = ,
SDLK_F4 = ,
SDLK_F5 = ,
SDLK_F6 = ,
SDLK_F7 = ,
SDLK_F8 = ,
SDLK_F9 = ,
SDLK_F10 = ,
SDLK_F11 = ,
SDLK_F12 = ,
SDLK_F13 = ,
SDLK_F14 = ,
SDLK_F15 = ,
/*@}*/ /** @name Key state modifier keys */
/*@{*/
SDLK_NUMLOCK = ,
SDLK_CAPSLOCK = ,
SDLK_SCROLLOCK = ,
SDLK_RSHIFT = ,
SDLK_LSHIFT = ,
SDLK_RCTRL = ,
SDLK_LCTRL = ,
SDLK_RALT = ,
SDLK_LALT = ,
SDLK_RMETA = ,
SDLK_LMETA = ,
SDLK_LSUPER = , /**< Left "Windows" key */
SDLK_RSUPER = , /**< Right "Windows" key */
SDLK_MODE = , /**< "Alt Gr" key */
SDLK_COMPOSE = , /**< Multi-key compose key */
/*@}*/ /** @name Miscellaneous function keys */
/*@{*/
SDLK_HELP = ,
SDLK_PRINT = ,
SDLK_SYSREQ = ,
SDLK_BREAK = ,
SDLK_MENU = ,
SDLK_POWER = , /**< Power Macintosh power key */
SDLK_EURO = , /**< Some european keyboards */
SDLK_UNDO = , /**< Atari keyboard has Undo */
/*@}*/ /* Add any other keys here */ SDLK_LAST
} SDLKey;

SDL中按键对应的值的更多相关文章

  1. zigbee学习:示例程序SampleApp中按键工作流程

    zigbee学习:示例程序SampleApp中按键工作流程 本文博客链接:http://blog.csdn.net/jdh99,作者:jdh,转载请注明. 环境: 主机:WIN7 开发环境:IAR8. ...

  2. 使用JS,获取URL中指定参数的值

    /** * 获取URL中指定参数的值 * * @param name 参数名称 * @returns */ function getQueryString(name) { var reg = new ...

  3. 取出session中的所有属性与值的方法

    如果你想取出session中所有的属性和值,可以通过getAttributeNames()方法来实现,具体代码如下 //获取session HttpSession session = request. ...

  4. php usort 按照数组中的某个键值排序

    //php usort 按照数组中的某个键值排序 如果第一个参数小于第二个参数 -> 返回小于0的整数如果第一个参数等于于第二个参数 -> 返回等于0的整数如果第一个参数大于于第二个参数 ...

  5. 更改mysql中当前auto_increment的值的方法

    最近给自己网站更改mysql中当前auto_increment的值 如果在mysql中一个表test中的ID字段设为auto_increment插入两条记录后ID=2,这时删除1条记录,再插入一条变成 ...

  6. 关于Oracle中查询的数字值的显示格式需要保留小数点后两位(或者三位,及其他位数)

    关于Oracle中查询的数字值的显示格式需要保留小数点后两位(或者三位,及其... 方法一:使用to_char的fm格式,即: to_char(round(data.amount,2),'FM9999 ...

  7. mysql中数据类型的取值范围

    mysql整型bigint.int.mediumint.smallint 和 tinyint的语法介绍,如下: 1.bigint 从 -2^63 (-9223372036854775808) 到 2^ ...

  8. Linq 中按照多个值进行分组(GroupBy)

    Linq 中按照多个值进行分组(GroupBy) .GroupBy(x => new { x.Age, x.Sex }) group emp by new { emp.Age, emp.Sex ...

  9. [CareerCup] 17.4 Maximum of Two Numbers 两数中的较大值

    17.4 Write a method which finds the maximum of two numbers. You should not use if-else or any other ...

随机推荐

  1. react native navigationOptions中不能获取this

    static navigationOptions = ({ navigation, navigationOptions,screenProps }) => { const { params } ...

  2. python魔法方法之构造和析构

    python的类实例化的时候会默认执行该类的构造方法_init_ class Rectangle: def __init__(self,x,y): self.x=x self.y=y def getA ...

  3. Eclipse使用Git检出项目

    1.打开Eclipse——File——Import...: 2.在弹出的Import框中选择Git——Projects from Git——NEXT: 3.选择Clone URI——Next: 4.输 ...

  4. easyui datagrid使用按钮

    $('#datagrid').datagrid({ border:false, fitColumns:true, singleSelect: true, url:url, columns:[[ {fi ...

  5. scrollview 嵌套imageview显示长图

    起初使用代码如下:但是图片显示不全,上半截被截 <ScrollView android:layout_width="match_parent" android:layout_ ...

  6. LeetCode第十七题-电话号码的字母组合

    Letter Combinations of a Phone Number 问题简介: 给定包含2-9的数字的字符串,返回该数字可能表示的所有可能的字母组合. 下面给出了数字到字母的映射(就像在电话按 ...

  7. git本机服务器配置(一):git的安装

    1. 下载git的Windows版本 https://gitforwindows.org/ 2. 安装 点击next 不需要更改,直接点击next 配置git编辑器,我安装了notepad++所以就选 ...

  8. java学习笔记03-基本语法

    编写java程序时,应注意以下点: 大小写敏感:Java是大小写敏感的,这就意味着标识符Hello与hello是不同的. 类名:对于所有的类来说,类名的首字母应该大写.如果类名由若干单词组成,那么每个 ...

  9. memcached单机或热备的安装部署

    一.部署准备 1.安装Java 不建议使用系统默认Open JDK版本,需要手工另行安装.JDK版本建议为1.7+,若Java已安装完毕,则无需重复安装. 安装过程如下: (1)获取JDK安装包: ( ...

  10. WPF 10天修炼 第四天- WPF布局容器

    WPF布局 WPF的窗口也就是Window类,是一个内容控件,该控件派生自ContentControl.内容控件有一个Content属性,该属性有一个限制,只能放置一个用户界面元素,或一个字符串.为了 ...