想用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. springboot springmvc拦截器 拦截POST、PUT、DELETE请求参数和响应数据,并记录操作日志

    1.操作日志实体类 @Document(collection = "operation_log") @Getter @Setter @ToString public class O ...

  2. python之map,filter

    map和filter是python里面比较重要的BIF,map的主要作用就是对集合里面的每一个元素进行处理,filter的作用就是过滤集合,具体功能如下 t =lambda x:x%2 list(fi ...

  3. CSS之Background

    实验环境 [Windows 10] Chrome 73.0.3683.103(386,64bit) background作用范围 content+padding 参考文献 [1] CSS backgr ...

  4. gdb nnet3-compute

    gdb nnet3-compute测试命令 $ matrix-dim 'scp: head -n 1 data/test/feats.scp|' ~/kaldi/src/bin/matrix-dim ...

  5. JavaScript—对象创建方式

    JavaScript 也是面向对象的语言(oop) 之前学JavaScript 没有学对象.现在做下笔记 创建对象的方式: 1.  对象字面量 const hero = { name: '吕布', w ...

  6. Deep Mutual Learning

    论文地址: https://arxiv.org/abs/1706.00384 论文简介 该论文探讨了一种与模型蒸馏(model distillation)相关却不同的模型---即相互学习(mutual ...

  7. mysql GTID

    之前一直通过binlog主从同步,现在发现GTID这种方式,记录一下,具体可参考网上教程.感觉配置使用更为简单方便,不知实际效果如何.

  8. 适用于typecho0.9的评论表情插件

    依旧是寻找插件,实在是太累人,很多插件现在更新后不支持typecho0.9了,今天想给评论框加一个表情拓展,发现新版本的插件完全不兼容typecho0.9,无奈用回旧版本····· 实际上,旧版本的插 ...

  9. luoguP2502旅行

    2006河南省选 思路:(参考题解) 枚举最大的边(第\(i\)条),从这条边开始由大到小枚举.添边,当\(s\)和\(t\)联通时,此时即为以第\(i\)条边为最大边的答案,比较每个答案,判断输出. ...

  10. layui报错 "Layui hint: 模块名 xxx 已被占用" 的问题解决方案

    由于扩展模块数量众多, 于是我需要将扩展模块分类到二级文件夹中, 我在页面中是这么写的 <script> layui.extend({ courseTask: 'task/courseTa ...