Changeset 28a5ebd in mainline for uspace/srv/hid/input/layout/ar.c
- Timestamp:
- 2020-06-18T15:39:50Z (4 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- ce52c333
- Parents:
- 4f663f3e
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/hid/input/layout/ar.c
r4f663f3e r28a5ebd 44 44 static errno_t ar_create(layout_t *); 45 45 static void ar_destroy(layout_t *); 46 static wchar_t ar_parse_ev(layout_t *, kbd_event_t *ev);46 static char32_t ar_parse_ev(layout_t *, kbd_event_t *ev); 47 47 48 48 layout_ops_t ar_ops = { … … 52 52 }; 53 53 54 static wchar_t map_not_shifted[] = {54 static char32_t map_not_shifted[] = { 55 55 [KC_BACKTICK] = L'ذ', 56 56 … … 110 110 }; 111 111 112 static wchar_t map_shifted[] = {112 static char32_t map_shifted[] = { 113 113 [KC_BACKTICK] = L'ّ', 114 114 … … 168 168 }; 169 169 170 static wchar_t map_neutral[] = {170 static char32_t map_neutral[] = { 171 171 [KC_BACKSPACE] = '\b', 172 172 [KC_TAB] = '\t', … … 181 181 }; 182 182 183 static wchar_t map_numeric[] = {183 static char32_t map_numeric[] = { 184 184 [KC_N7] = '7', 185 185 [KC_N8] = '8', … … 196 196 }; 197 197 198 static wchar_t translate(unsigned int key, wchar_t *map, size_t map_length)198 static char32_t translate(unsigned int key, char32_t *map, size_t map_length) 199 199 { 200 200 if (key >= map_length) … … 212 212 } 213 213 214 static wchar_t ar_parse_ev(layout_t *state, kbd_event_t *ev)215 { 216 wchar_t c;214 static char32_t ar_parse_ev(layout_t *state, kbd_event_t *ev) 215 { 216 char32_t c; 217 217 218 218 /* Produce no characters when Ctrl or Alt is pressed. */ … … 220 220 return 0; 221 221 222 c = translate(ev->key, map_neutral, sizeof(map_neutral) / sizeof( wchar_t));222 c = translate(ev->key, map_neutral, sizeof(map_neutral) / sizeof(char32_t)); 223 223 if (c != 0) 224 224 return c; 225 225 226 226 if ((ev->mods & KM_SHIFT) != 0) 227 c = translate(ev->key, map_shifted, sizeof(map_shifted) / sizeof( wchar_t));227 c = translate(ev->key, map_shifted, sizeof(map_shifted) / sizeof(char32_t)); 228 228 else 229 c = translate(ev->key, map_not_shifted, sizeof(map_not_shifted) / sizeof( wchar_t));229 c = translate(ev->key, map_not_shifted, sizeof(map_not_shifted) / sizeof(char32_t)); 230 230 231 231 if (c != 0) … … 233 233 234 234 if ((ev->mods & KM_NUM_LOCK) != 0) 235 c = translate(ev->key, map_numeric, sizeof(map_numeric) / sizeof( wchar_t));235 c = translate(ev->key, map_numeric, sizeof(map_numeric) / sizeof(char32_t)); 236 236 else 237 237 c = 0;
Note:
See TracChangeset
for help on using the changeset viewer.