192,7 → 192,8 |
|
static int translate(unsigned int key, char *map, size_t map_length) |
{ |
if (key >= map_length) return 0; |
if (key >= map_length) |
return 0; |
return map[key]; |
} |
|
205,7 → 206,8 |
return 0; |
|
c = translate(ev->key, map_neutral, sizeof(map_neutral) / sizeof(char)); |
if (c != 0) return c; |
if (c != 0) |
return c; |
|
if (((ev->mods & KM_SHIFT) != 0) ^ ((ev->mods & KM_CAPS_LOCK) != 0)) |
c = translate(ev->key, map_ucase, sizeof(map_ucase) / sizeof(char)); |
212,7 → 214,8 |
else |
c = translate(ev->key, map_lcase, sizeof(map_lcase) / sizeof(char)); |
|
if (c != 0) return c; |
if (c != 0) |
return c; |
|
if ((ev->mods & KM_SHIFT) != 0) |
c = translate(ev->key, map_shifted, sizeof(map_shifted) / sizeof(char)); |
219,7 → 222,8 |
else |
c = translate(ev->key, map_not_shifted, sizeof(map_not_shifted) / sizeof(char)); |
|
if (c != 0) return c; |
if (c != 0) |
return c; |
|
if ((ev->mods & KM_NUM_LOCK) != 0) |
c = translate(ev->key, map_numeric, sizeof(map_numeric) / sizeof(char)); |