SDL中按鍵對應的值

2022-06-25 03:06:08 字數 560 閱讀 5614

想用sdl的按鍵檢測,網上找了半天都沒找到sdl中按鍵的值的定義,索性自己去看標頭檔案,在sdl_keysym.h中。

其實很多鍵的值和它們的ascii碼是相同的。

其他更多的用法,可以參考這篇部落格:

typedef enum

*//*

* @name international keyboard syms

*//*@*/

/** @name numeric keypad

*//*@*/

/** @name arrows + home/end pad

*//*@*/

/** @name function keys

*//*@*/

/** @name key state modifier keys

*//*@*/

/** @name miscellaneous function keys

*//*@*/

/*add any other keys here

*/sdlk_last

} sdlkey;

鍵盤按鍵對應的ASCII碼值

ascii表 ascii值 控制字元 ascii值 控制字元 ascii值 控制字元 ascii值 控制字元 0nut 32 space 64 96 1soh33!65a97a 2stx34 66b98b 3etx35 67c99c 4eot36 68d100d 5enq37 69e101e 6ac...

鍵盤各鍵對應的值

描述 16進製制 0x1 滑鼠左鍵 0x2 滑鼠右鍵 0x3 cancel 鍵 0x4 滑鼠中鍵 0x8 backspace 鍵 0x9 tab 鍵 0xc clear 鍵 0xd enter 鍵 0x10 shift 鍵 0x11 ctrl 鍵 0x12 menu 鍵 0x13 pause 鍵 0...

獲取list中Top K個值對應的索引

在得到概率分布的list之後,想要得到 top k個概率值及其索引,因為索引對應著label id。import numpy as np p 0.07,0.2,0.1,0.03,0.1,0.5 topk 2 print 方法1 index list sorted range len p key la...