|
|
1.1 root 1: //
2: // nono
1.1.1.3 root 3: // Copyright (C) 2020 nono project
4: // Licensed under nono-license.txt
1.1 root 5: //
6:
7: #include "keyboard.h"
8:
1.1.1.2 root 9: std::unique_ptr<Keyboard> gKeyboard;
1.1 root 10:
11: // コンストラクタ
12: Keyboard::Keyboard()
13: {
14: logname = "keyboard";
15: devname = "Keyboard";
16: }
17:
18: // デストラクタ
19: Keyboard::~Keyboard()
20: {
21: }
22:
23: // キー名を返す (主にデバッグ用)
24: const std::string
25: Keyboard::GetName(uint code)
26: {
27: if (code >= keyname.size()) {
28: return string_format("(keycode=0x%x, out of range)", code);
29: }
30: if (keyname[code] == NULL) {
31: return string_format("(keycode=0x%x)", code);
32: }
33: return std::string(keyname[code]);
34: }
35:
36: /*static*/ std::vector<const char *>
37: Keyboard::keyname {
38: "(none)", // 00
39: "BREAK", // 01
40: "COPY", // 02
41: "romaji", // 03
42: "code", // 04
43: "kigou", // 05
44: "touroku", // 06
45: "HELP", // 07
46: "HOME", // 08
47: "TAB", // 09
48: "CTRL", // 0a
49: "kana", // 0b
50: "SHIFT_L", // 0c
51: "SHIFT_R", // 0d
52: "CAPS", // 0e
53: "SF", // 0f
54:
55: "ESC", // 10
56: "BS", // 11
57: "enter", // 12
58: "INS", // 13
59: "space", // 14
60: "DEL", // 15
61: "XFER", // 16
62: "VALID", // 17
63: "PF11", // 18
64: "PF12", // 19
65: "PF13", // 1a
66: "PF14", // 1b
67: "up", // 1c
68: "left", // 1d
69: "right", // 1e
70: "down", // 1f
71:
72: "ROLLUP", // 20
73: "ROLLDOWN", // 21
74: "1", // 22
75: "2", // 23
76: "3", // 24
77: "4", // 25
78: "5", // 26
79: "6", // 27
80: "7", // 28
81: "8", // 29
82: "9", // 2a
83: "0", // 2b
84: "minus", // 2c
85: "circum", // 2d
86: "backslash", // 2e
87: "UNDO", // 2f
88:
89: "OPT1", // 30
90: "OPT2", // 31
91: "Q", // 32
92: "W", // 33
93: "E", // 34
94: "R", // 35
95: "T", // 36
96: "Y", // 37
97: "U", // 38
98: "I", // 39
99: "O", // 3a
100: "P", // 3b
101: "at", // 3c
102: "bracketleft", // 3d
103: "hira", // 3e
104: "zenkaku", // 3f
105:
106: NULL, // 40
107: NULL, // 41
108: "A", // 42
109: "S", // 43
110: "D", // 44
111: "F", // 45
112: "G", // 46
113: "H", // 47
114: "J", // 48
115: "K", // 49
116: "L", // 4a
117: "semicolon", // 4b
118: "colon", // 4c
119: "bracketright", // 4d
120: NULL, // 4e
121: NULL, // 4f
122:
123: NULL, // 50
124: NULL, // 51
125: "Z", // 52
126: "X", // 53
127: "C", // 54
128: "V", // 55
129: "B", // 56
130: "N", // 57
131: "M", // 58
132: "comma", // 59
133: "period", // 5a
134: "slash", // 5b
135: "underscore", // 5c
136: NULL, // 5d
137: NULL, // 5e
138: NULL, // 5f
139:
140: NULL, // 60
141: "PAD_plus", // 61
142: "PAD_minus", // 62
143: "PAD_7", // 63
144: "PAD_8", // 64
145: "PAD_9", // 65
146: "PAD_4", // 66
147: "PAD_5", // 67
148: "PAD_6", // 68
149: "PAD_1", // 69
150: "PAD_2", // 6a
151: "PAD_3", // 6b
152: "PAD_0", // 6c
153: "PAD_decimal", // 6d
154: "PAD_enter", // 6e
155: "PAD_CLR", // 6f
156:
157: NULL, // 70
158: NULL, // 71
159: "F1", // 72
160: "F2", // 73
161: "F3", // 74
162: "F4", // 75
163: "F5", // 76
164: "F6", // 77
165: "F7", // 78
166: "F8", // 79
167: "F9", // 7a
168: "F10", // 7b
169: "PAD_multiply", // 7c
170: "PAD_divide", // 7d
171: "PAD_equal", // 7e
172: "PAD_comma", // 7f
173:
174: "XF1", // 80
175: "XF2", // 81
176: "XF3", // 82
177: "XF4", // 83
178: "XF5", // 84
179: };
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.