Changeset 28a5ebd in mainline for uspace/srv/hid/input/layout/fr_azerty.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/fr_azerty.c
r4f663f3e r28a5ebd 43 43 static errno_t fr_azerty_create (layout_t *); 44 44 static void fr_azerty_destroy (layout_t *); 45 static wchar_t fr_azerty_parse_ev (layout_t *, kbd_event_t *);45 static char32_t fr_azerty_parse_ev (layout_t *, kbd_event_t *); 46 46 47 47 layout_ops_t fr_azerty_ops = { … … 51 51 }; 52 52 53 static wchar_t map_lcase[] = {53 static char32_t map_lcase[] = { 54 54 [KC_Q] = 'a', 55 55 [KC_W] = 'z', … … 82 82 }; 83 83 84 static wchar_t map_ucase[] = {84 static char32_t map_ucase[] = { 85 85 [KC_Q] = 'A', 86 86 [KC_W] = 'Z', … … 117 117 }; 118 118 119 static wchar_t map_not_shifted[] = {119 static char32_t map_not_shifted[] = { 120 120 [KC_BACKTICK] = L'²', 121 121 … … 146 146 }; 147 147 148 static wchar_t map_shifted[] = {148 static char32_t map_shifted[] = { 149 149 [KC_M] = '?', 150 150 [KC_BACKTICK] = '~', … … 176 176 }; 177 177 178 static wchar_t map_neutral[] = {178 static char32_t map_neutral[] = { 179 179 [KC_BACKSPACE] = '\b', 180 180 [KC_TAB] = '\t', … … 189 189 }; 190 190 191 static wchar_t map_numeric[] = {191 static char32_t map_numeric[] = { 192 192 [KC_N7] = '7', 193 193 [KC_N8] = '8', … … 204 204 }; 205 205 206 static wchar_t translate (unsigned int key, wchar_t *map, size_t map_len)206 static char32_t translate (unsigned int key, char32_t *map, size_t map_len) 207 207 { 208 208 if (key >= map_len) … … 221 221 } 222 222 223 static wchar_t fr_azerty_parse_ev (layout_t *s, kbd_event_t *e)223 static char32_t fr_azerty_parse_ev (layout_t *s, kbd_event_t *e) 224 224 { 225 225 if ((e->mods & (KM_CTRL | KM_ALT))) 226 226 return 0; // Produce no characters when Ctrl or Alt is pressed 227 227 228 wchar_t c = translate (e->key, map_neutral, sizeof (map_neutral) / sizeof (wchar_t));228 char32_t c = translate (e->key, map_neutral, sizeof (map_neutral) / sizeof (char32_t)); 229 229 if (c) 230 230 return c; 231 231 232 232 if ((e->mods & KM_SHIFT)) 233 c = translate (e->key, map_shifted, sizeof (map_shifted) / sizeof ( wchar_t));233 c = translate (e->key, map_shifted, sizeof (map_shifted) / sizeof (char32_t)); 234 234 else 235 c = translate (e->key, map_not_shifted, sizeof (map_not_shifted) / sizeof ( wchar_t));235 c = translate (e->key, map_not_shifted, sizeof (map_not_shifted) / sizeof (char32_t)); 236 236 237 237 if (c) … … 239 239 240 240 if (((e->mods & KM_SHIFT)) ^ ((e->mods & KM_CAPS_LOCK))) 241 c = translate (e->key, map_ucase, sizeof (map_ucase) / sizeof ( wchar_t));241 c = translate (e->key, map_ucase, sizeof (map_ucase) / sizeof (char32_t)); 242 242 else 243 c = translate (e->key, map_lcase, sizeof (map_lcase) / sizeof ( wchar_t));243 c = translate (e->key, map_lcase, sizeof (map_lcase) / sizeof (char32_t)); 244 244 245 245 if (c) … … 247 247 248 248 if ((e->mods & KM_NUM_LOCK)) 249 c = translate (e->key, map_numeric, sizeof (map_numeric) / sizeof ( wchar_t));249 c = translate (e->key, map_numeric, sizeof (map_numeric) / sizeof (char32_t)); 250 250 else 251 251 c = 0;
Note:
See TracChangeset
for help on using the changeset viewer.