45 #include "x11keysym/keysym.h" 61 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
62 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
63 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
64 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
65 0x0029, 0x0116, 0x0152, 0x0126, 0x0125, 0x012e, 0x013d, 0x0052,
66 0x0146, 0x0145, 0x013e, 0x0155, 0x0041, 0x004e, 0x0049, 0x004a,
67 0x0045, 0x0016, 0x001e, 0x0026, 0x0025, 0x002e, 0x0036, 0x003d,
68 0x003e, 0x0046, 0x014c, 0x004c, 0x0141, 0x0055, 0x0149, 0x014a,
69 0x011e, 0x011c, 0x0132, 0x0121, 0x0123, 0x0124, 0x012b, 0x0134,
70 0x0133, 0x0143, 0x013b, 0x0142, 0x014b, 0x013a, 0x0131, 0x0144,
71 0x014d, 0x0115, 0x012d, 0x011b, 0x012c, 0x013c, 0x012a, 0x011d,
72 0x0122, 0x0135, 0x011a, 0x0054, 0x005d, 0x005b, 0x0136, 0x014e,
73 0x000e, 0x001c, 0x0032, 0x0021, 0x0023, 0x0024, 0x002b, 0x0034,
74 0x0033, 0x0043, 0x003b, 0x0042, 0x004b, 0x003a, 0x0031, 0x0044,
75 0x004d, 0x0015, 0x002d, 0x001b, 0x002c, 0x003c, 0x002a, 0x001d,
76 0x0022, 0x0035, 0x001a, 0x0154, 0x015d, 0x015b, 0x010e, 0x0000
88 if (key <= XK_asciitilde) {
89 uint16_t tmp = keySymToPs2Byte[key];
90 uint8_t code = tmp & 0xff;
91 bool shift = tmp >> 8;
94 if (!cur_shift && shift) {
95 keys.push_back(ShiftKey);
100 if (cur_shift && !shift) {
101 keys.push_back(BreakKey);
102 keys.push_back(ShiftKey);
105 keys.push_back(BreakKey);
106 keys.push_back(code);
109 if ((key & UpperKeys) == UpperKeys) {
110 bool extended =
false;
113 keys.push_back(0x66);
116 keys.push_back(0x0d);
119 keys.push_back(0x5a);
122 keys.push_back(0x76);
126 keys.push_back(0x71);
130 keys.push_back(0x6c);
134 keys.push_back(0x6b);
138 keys.push_back(0x74);
142 keys.push_back(0x72);
146 keys.push_back(0x75);
150 keys.push_back(0x7d);
154 keys.push_back(0x7a);
158 keys.push_back(0x69);
161 keys.push_back(0x12);
168 keys.push_back(0x59);
175 keys.push_back(0x14);
179 keys.push_back(0x14);
182 keys.push_back(0x11);
186 keys.push_back(0x11);
189 warn(
"Unknown extended key %#x\n", key);
195 keys.push_front(ExtendedKey);
197 keys.push_front(BreakKey);
198 keys.push_front(ExtendedKey);
202 keys.push_front(BreakKey);
const std::vector< uint8_t > ID
const uint8_t ExtendedKey
const std::vector< uint8_t > ID
bool bool std::list< uint8_t > & keys
void keySymToPs2(uint32_t key, bool down, bool &cur_shift, std::list< uint8_t > &keys)
static const uint16_t keySymToPs2Byte[128]
Table to convert simple key symbols (0x00XX) into ps2 bytes.