virtual key code | scan code | 名稱 | 備註 | ||
十進位 | 十六進位 | 十進位 | 十六進位 | ||
3 | 3 | 57414 | e046 | Break | 按Ctrl+Pause/Break會收到這個key code |
8 | 8 | 14 | e | Backspace | |
9 | 9 | 15 | f | Tab | |
12 | c | 76 | 4c | Num 5 | |
13 | d | 28 | 1c | Enter | |
16 | 10 | 42 | 2a | Shift | 真正的Shift、Ctrl和Alt在160~165 |
17 | 11 | 29 | 1d | Ctrl | |
18 | 12 | 56 | 38 | Alt | |
19 | 13 | 57629 | e11d | Right Ctrl | |
20 | 14 | 58 | 3a | Caps Lock | |
27 | 1b | 1 | 1 | Esc | |
32 | 20 | 57 | 39 | Space | |
33 | 21 | 73 | 49 | Num 9 | Page Up |
34 | 22 | 81 | 51 | Num 3 | Page Down |
35 | 23 | 79 | 4f | Num 1 | End |
36 | 24 | 71 | 47 | Num 7 | Home |
37 | 25 | 75 | 4b | Num 4 | ← |
38 | 26 | 72 | 48 | Num 8 | ↑ |
39 | 27 | 77 | 4d | Num 6 | → |
40 | 28 | 80 | 50 | Num 2 | ↓ |
44 | 2c | 84 | 54 | Sys Req | =Print Screen 自己寫的程式收不到這個按鈕的訊息,可能作業系統有特別處理。 |
45 | 2d | 82 | 52 | Num 0 | Insert |
46 | 2e | 83 | 53 | Num Del | Delete |
48 | 30 | 11 | b | 0 | |
49 | 31 | 2 | 2 | 1 | |
50 | 32 | 3 | 3 | 2 | |
51 | 33 | 4 | 4 | 3 | |
52 | 34 | 5 | 5 | 4 | |
53 | 35 | 6 | 6 | 5 | |
54 | 36 | 7 | 7 | 6 | |
55 | 37 | 8 | 8 | 7 | |
56 | 38 | 9 | 9 | 8 | |
57 | 39 | 10 | a | 9 | |
65 | 41 | 30 | 1e | A | |
66 | 42 | 48 | 30 | B | |
67 | 43 | 46 | 2e | C | |
68 | 44 | 32 | 20 | D | |
69 | 45 | 18 | 12 | E | |
70 | 46 | 33 | 21 | F | |
71 | 47 | 34 | 22 | G | |
72 | 48 | 35 | 23 | H | |
73 | 49 | 23 | 17 | I | |
74 | 4a | 36 | 24 | J | |
75 | 4b | 37 | 25 | K | |
76 | 4c | 38 | 26 | L | |
77 | 4d | 50 | 32 | M | |
78 | 4e | 49 | 31 | N | |
79 | 4f | 24 | 18 | O | |
80 | 50 | 25 | 19 | P | |
81 | 51 | 16 | 10 | Q | |
82 | 52 | 19 | 13 | R | |
83 | 53 | 31 | 1f | S | |
84 | 54 | 20 | 14 | T | |
85 | 55 | 22 | 16 | U | |
86 | 56 | 47 | 2f | V | |
87 | 57 | 17 | 11 | W | |
88 | 58 | 45 | 2d | X | |
89 | 59 | 21 | 15 | Y | |
90 | 5a | 44 | 2c | Z | |
91 | 5b | 57435 | e05b | Left Windows | |
92 | 5c | 57436 | e05c | Right Windows | |
93 | 5d | 57437 | e05d | Application | |
96 | 60 | 82 | 52 | Num 0 | 九宮格鍵 |
97 | 61 | 79 | 4f | Num 1 | |
98 | 62 | 80 | 50 | Num 2 | |
99 | 63 | 81 | 51 | Num 3 | |
100 | 64 | 75 | 4b | Num 4 | |
101 | 65 | 76 | 4c | Num 5 | |
102 | 66 | 77 | 4d | Num 6 | |
103 | 67 | 71 | 47 | Num 7 | |
104 | 68 | 72 | 48 | Num 8 | |
105 | 69 | 73 | 49 | Num 9 | |
106 | 6a | 55 | 37 | Num * | |
107 | 6b | 78 | 4e | Num + | |
109 | 6d | 74 | 4a | Num - | |
110 | 6e | 83 | 53 | Num Del | |
111 | 6f | 57397 | e035 | Num / | |
112 | 70 | 59 | 3b | F1 | |
113 | 71 | 60 | 3c | F2 | |
114 | 72 | 61 | 3d | F3 | |
115 | 73 | 62 | 3e | F4 | |
116 | 74 | 63 | 3f | F5 | |
117 | 75 | 64 | 40 | F6 | |
118 | 76 | 65 | 41 | F7 | |
119 | 77 | 66 | 42 | F8 | |
120 | 78 | 67 | 43 | F9 | |
121 | 79 | 68 | 44 | F10 | |
122 | 7a | 87 | 57 | F11 | |
123 | 7b | 88 | 58 | F12 | |
144 | 90 | 69 | 45 | Pause | 只按Pause/Break鈕 |
145 | 91 | 70 | 46 | Scroll Lock | |
160 | a0 | 42 | 2a | Shift | |
161 | a1 | 54 | 36 | Right Shift | |
162 | a2 | 29 | 1d | Ctrl | |
163 | a3 | 57373 | e01d | Right Ctrl | |
164 | a4 | 56 | 38 | Alt | |
165 | a5 | 57400 | e038 | Right Alt | |
172 | ac | 57394 | e032 | M | |
173 | ad | 57376 | e020 | D | 靜音 173~179為控制媒體播放 |
174 | ae | 57390 | e02e | C | 音量調低 |
175 | af | 57392 | e030 | B | 音量調高 |
176 | b0 | 57369 | e019 | P | 下一首 |
177 | b1 | 57360 | e010 | Q | 前一首 |
178 | b2 | 57380 | e024 | J | |
179 | b3 | 57378 | e022 | G | 播放、暫停 |
183 | b7 | 57377 | e021 | F | |
186 | ba | 39 | 27 | ; | |
187 | bb | 13 | d | = | |
188 | bc | 51 | 33 | , | |
189 | bd | 12 | c | - | |
190 | be | 52 | 34 | . | |
191 | bf | 53 | 35 | / | |
192 | c0 | 41 | 29 | ` | |
194 | c2 | 126 | 7e | F15 | |
219 | db | 26 | 1a | [ | |
220 | dc | 43 | 2b | \ | |
221 | dd | 27 | 1b | ] | |
222 | de | 40 | 28 | ' | |
226 | e2 | 86 | 56 | \ |
#define UNICODE #include<windows.h> #include<stdint.h> #include<stdio.h> #define BUFFER_SIZE 64 int main(){ WCHAR keyName[BUFFER_SIZE]; for(uint32_t vk=0;vk<=255;vk++){ uint32_t scanCode=MapVirtualKey(vk, MAPVK_VK_TO_VSC_EX); if(scanCode==0){ continue; } //要把scanCode做如下的處理才能給GetKeyNameText() uint32_t scanCode2=scanCode; if(scanCode2>0x100){ //scanCode=0xe0??或0xe1??,要把extended flag設成1 scanCode2|=0x100; } int ret=GetKeyNameText(scanCode2<<16, keyName, BUFFER_SIZE); if(ret==0){ continue; } wprintf(L"%u %u %s\n",vk, scanCode,keyName); } return 0; } |
X key code | keysym | 名稱 | 備註 | ||
十進位 | 十六進位 | 十進位 | 十六進位 | ||
9 | 9 | 65307 | ff1b | Escape | Esc |
10 | a | 49 | 31 | 1 | |
11 | b | 50 | 32 | 2 | |
12 | c | 51 | 33 | 3 | |
13 | d | 52 | 34 | 4 | |
14 | e | 53 | 35 | 5 | |
15 | f | 54 | 36 | 6 | |
16 | 10 | 55 | 37 | 7 | |
17 | 11 | 56 | 38 | 8 | |
18 | 12 | 57 | 39 | 9 | |
19 | 13 | 48 | 30 | 0 | |
20 | 14 | 45 | 2d | minus | - |
21 | 15 | 61 | 3d | equal | = |
22 | 16 | 65288 | ff08 | BackSpace | |
23 | 17 | 65289 | ff09 | Tab | |
24 | 18 | 113 | 71 | q | |
25 | 19 | 119 | 77 | w | |
26 | 1a | 101 | 65 | e | |
27 | 1b | 114 | 72 | r | |
28 | 1c | 116 | 74 | t | |
29 | 1d | 121 | 79 | y | |
30 | 1e | 117 | 75 | u | |
31 | 1f | 105 | 69 | i | |
32 | 20 | 111 | 6f | o | |
33 | 21 | 112 | 70 | p | |
34 | 22 | 91 | 5b | bracketleft | [ |
35 | 23 | 93 | 5d | bracketright | ] |
36 | 24 | 65293 | ff0d | Return | Enter |
37 | 25 | 65507 | ffe3 | Control_L | |
38 | 26 | 97 | 61 | a | |
39 | 27 | 115 | 73 | s | |
40 | 28 | 100 | 64 | d | |
41 | 29 | 102 | 66 | f | |
42 | 2a | 103 | 67 | g | |
43 | 2b | 104 | 68 | h | |
44 | 2c | 106 | 6a | j | |
45 | 2d | 107 | 6b | k | |
46 | 2e | 108 | 6c | l | |
47 | 2f | 59 | 3b | semicolon | ; |
48 | 30 | 39 | 27 | apostrophe | ' |
49 | 31 | 96 | 60 | grave | ` |
50 | 32 | 65505 | ffe1 | Shift_L | |
51 | 33 | 92 | 5c | backslash | \ |
52 | 34 | 122 | 7a | z | |
53 | 35 | 120 | 78 | x | |
54 | 36 | 99 | 63 | c | |
55 | 37 | 118 | 76 | v | |
56 | 38 | 98 | 62 | b | |
57 | 39 | 110 | 6e | n | |
58 | 3a | 109 | 6d | m | |
59 | 3b | 44 | 2c | comma | , |
60 | 3c | 46 | 2e | period | . |
61 | 3d | 47 | 2f | slash | / |
62 | 3e | 65506 | ffe2 | Shift_R | |
63 | 3f | 65450 | ffaa | KP_Multiply | 名稱有KP_的是九宮格鍵 |
64 | 40 | 65513 | ffe9 | Alt_L | |
65 | 41 | 32 | 20 | space | |
66 | 42 | 65509 | ffe5 | Caps_Lock | |
67 | 43 | 65470 | ffbe | F1 | |
68 | 44 | 65471 | ffbf | F2 | |
69 | 45 | 65472 | ffc0 | F3 | |
70 | 46 | 65473 | ffc1 | F4 | |
71 | 47 | 65474 | ffc2 | F5 | |
72 | 48 | 65475 | ffc3 | F6 | |
73 | 49 | 65476 | ffc4 | F7 | |
74 | 4a | 65477 | ffc5 | F8 | |
75 | 4b | 65478 | ffc6 | F9 | |
76 | 4c | 65479 | ffc7 | F10 | |
77 | 4d | 65407 | ff7f | Num_Lock | |
78 | 4e | 65300 | ff14 | Scroll_Lock | |
79 | 4f | 65429 | ff95 | KP_Home | |
80 | 50 | 65431 | ff97 | KP_Up | |
81 | 51 | 65434 | ff9a | KP_Prior | |
82 | 52 | 65453 | ffad | KP_Subtract | |
83 | 53 | 65430 | ff96 | KP_Left | |
84 | 54 | 65437 | ff9d | KP_Begin | |
85 | 55 | 65432 | ff98 | KP_Right | |
86 | 56 | 65451 | ffab | KP_Add | |
87 | 57 | 65436 | ff9c | KP_End | |
88 | 58 | 65433 | ff99 | KP_Down | |
89 | 59 | 65435 | ff9b | KP_Next | |
90 | 5a | 65438 | ff9e | KP_Insert | |
91 | 5b | 65439 | ff9f | KP_Delete | |
92 | 5c | 65027 | fe03 | ISO_Level3_Shift | |
94 | 5e | 60 | 3c | less | < |
95 | 5f | 65480 | ffc8 | F11 | |
96 | 60 | 65481 | ffc9 | F12 | |
98 | 62 | 65318 | ff26 | Katakana | |
99 | 63 | 65317 | ff25 | Hiragana | |
100 | 64 | 65315 | ff23 | Henkan_Mode | |
101 | 65 | 65319 | ff27 | Hiragana_Katakana | |
102 | 66 | 65314 | ff22 | Muhenkan | |
104 | 68 | 65421 | ff8d | KP_Enter | |
105 | 69 | 65508 | ffe4 | Control_R | |
106 | 6a | 65455 | ffaf | KP_Divide | |
107 | 6b | 65377 | ff61 | Print Screen | |
108 | 6c | 65514 | ffea | Alt_R | |
109 | 6d | 65290 | ff0a | Linefeed | |
110 | 6e | 65360 | ff50 | Home | |
111 | 6f | 65362 | ff52 | Up | ↑ |
112 | 70 | 65365 | ff55 | Prior | Page Up |
113 | 71 | 65361 | ff51 | Left | ← |
114 | 72 | 65363 | ff53 | Right | → |
115 | 73 | 65367 | ff57 | End | |
116 | 74 | 65364 | ff54 | Down | ↓ |
117 | 75 | 65366 | ff56 | Next | Page Down |
118 | 76 | 65379 | ff63 | Insert | |
119 | 77 | 65535 | ffff | Delete | |
125 | 7d | 65469 | ffbd | KP_Equal | |
126 | 7e | 177 | b1 | plusminus | |
127 | 7f | 65299 | ff13 | Pause | |
129 | 81 | 65454 | ffae | KP_Decimal | |
130 | 82 | 65329 | ff31 | Hangul | |
131 | 83 | 65332 | ff34 | Hangul_Hanja | |
133 | 85 | 65515 | ffeb | Super_L | Windows按鈕 |
134 | 86 | 65516 | ffec | Super_R | |
135 | 87 | 65383 | ff67 | Menu | |
136 | 88 | 65385 | ff69 | Cancel | |
137 | 89 | 65382 | ff66 | Redo | |
138 | 8a | 268828528 | 1005ff70 | SunProps | |
139 | 8b | 65381 | ff65 | Undo | |
140 | 8c | 268828529 | 1005ff71 | SunFront | |
144 | 90 | 65384 | ff68 | Find | |
146 | 92 | 65386 | ff6a | Help | |
187 | bb | 40 | 28 | parenleft | 字面意思是括號,筆者的鍵盤沒有此鈕 |
188 | bc | 41 | 29 | parenright | |
190 | be | 65382 | ff66 | Redo | |
203 | cb | 65406 | ff7e | Mode_switch | |
218 | da | 65377 | ff61 | ||
231 | e7 | 65385 | ff69 | Cancel |
X key code | keysym | 名稱 | 備註 | ||
十進位 | 十六進位 | 十進位 | 十六進位 | ||
121 | 79 | 269025042 | 1008ff12 | XF86AudioMute | 靜音 |
122 | 7a | 269025041 | 1008ff11 | XF86AudioLowerVolume | 音量調低 |
123 | 7b | 269025043 | 1008ff13 | XF86AudioRaiseVolume | 音量調高 |
150 | 96 | 269025071 | 1008ff2f | XF86Sleep | 睡眠 |
171 | ab | 269025047 | 1008ff17 | XF86AudioNext | 播放媒體用的按鈕 |
172 | ac | 269025044 | 1008ff14 | XF86AudioPlay | |
173 | ad | 269025046 | 1008ff16 | XF86AudioPrev | |
174 | ae | 269025045 | 1008ff15 | XF86AudioStop | |
200 | c8 | 269025200 | 1008ffb0 | XF86TouchpadOn | 啟用觸控板 |
201 | c9 | 269025201 | 1008ffb1 | XF86TouchpadOff | 停用觸控板 |
232 | e8 | 269025027 | 1008ff03 | XF86MonBrightnessDown | 調低高度 |
233 | e9 | 269025026 | 1008ff02 | XF86MonBrightnessUp | 調高亮度 |
235 | eb | 269025113 | 1008ff59 | XF86Display | 外接螢幕時切換顯示模式 |
246 | f6 | 269025173 | 1008ff95 | XF86WLAN | 開、關無線網路 |
#include<X11/XKBlib.h> #include<stdio.h> #include<stdint.h> int main(){ Display* dsp = XOpenDisplay( NULL ); if( !dsp ){ printf("Can't open XDisplay\n"); return 1; } for(uint32_t keyCode=0;keyCode<=255;keyCode++){ KeySym keySym=XkbKeycodeToKeysym(dsp,keyCode,0,0); char* keyName=XKeysymToString(keySym); if(keyName==NULL){ continue; } printf("%u %u %s\n",keyCode,keySym,keyName); } XCloseDisplay(dsp); return 0; } |
活動與參展 (0)
└活動與參展資訊 (1)
└活動與製作後記 (11)
└販售會遊戲團調查 (14)
遊戲團隊「電子妖精實驗室」 (0)
└重要消息 (4)
└Cyber Sprite遊戲秘密 (2)
└製作進度 (26)
創作 (0)
└繪圖 (24)
└程式 (48)
└故事、劇本 (3)
Airsoftotaku 給 大家:
"【Merry】校園紅人與哥德女孩42"翻譯好囉!來AO翻迷因的小屋看吧!看更多12小時前