Changeset 28a5ebd in mainline for uspace/srv/hid/input/layout/us_dvorak.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/us_dvorak.c
r4f663f3e r28a5ebd 43 43 static errno_t us_dvorak_create(layout_t *); 44 44 static void us_dvorak_destroy(layout_t *); 45 static wchar_t us_dvorak_parse_ev(layout_t *, kbd_event_t *ev);45 static char32_t us_dvorak_parse_ev(layout_t *, kbd_event_t *ev); 46 46 47 47 layout_ops_t us_dvorak_ops = { … … 51 51 }; 52 52 53 static wchar_t map_lcase[] = {53 static char32_t map_lcase[] = { 54 54 [KC_R] = 'p', 55 55 [KC_T] = 'y', … … 84 84 }; 85 85 86 static wchar_t map_ucase[] = {86 static char32_t map_ucase[] = { 87 87 [KC_R] = 'P', 88 88 [KC_T] = 'Y', … … 117 117 }; 118 118 119 static wchar_t map_not_shifted[] = {119 static char32_t map_not_shifted[] = { 120 120 [KC_BACKTICK] = '`', 121 121 … … 147 147 }; 148 148 149 static wchar_t map_shifted[] = {149 static char32_t map_shifted[] = { 150 150 [KC_BACKTICK] = '~', 151 151 … … 177 177 }; 178 178 179 static wchar_t map_neutral[] = {179 static char32_t map_neutral[] = { 180 180 [KC_BACKSPACE] = '\b', 181 181 [KC_TAB] = '\t', … … 190 190 }; 191 191 192 static wchar_t map_numeric[] = {192 static char32_t map_numeric[] = { 193 193 [KC_N7] = '7', 194 194 [KC_N8] = '8', … … 205 205 }; 206 206 207 static wchar_t translate(unsigned int key, wchar_t *map, size_t map_length)207 static char32_t translate(unsigned int key, char32_t *map, size_t map_length) 208 208 { 209 209 if (key >= map_length) … … 221 221 } 222 222 223 static wchar_t us_dvorak_parse_ev(layout_t *state, kbd_event_t *ev)224 { 225 wchar_t c;223 static char32_t us_dvorak_parse_ev(layout_t *state, kbd_event_t *ev) 224 { 225 char32_t c; 226 226 227 227 /* Produce no characters when Ctrl or Alt is pressed. */ … … 229 229 return 0; 230 230 231 c = translate(ev->key, map_neutral, sizeof(map_neutral) / sizeof( wchar_t));231 c = translate(ev->key, map_neutral, sizeof(map_neutral) / sizeof(char32_t)); 232 232 if (c != 0) 233 233 return c; 234 234 235 235 if (((ev->mods & KM_SHIFT) != 0) ^ ((ev->mods & KM_CAPS_LOCK) != 0)) 236 c = translate(ev->key, map_ucase, sizeof(map_ucase) / sizeof( wchar_t));236 c = translate(ev->key, map_ucase, sizeof(map_ucase) / sizeof(char32_t)); 237 237 else 238 c = translate(ev->key, map_lcase, sizeof(map_lcase) / sizeof( wchar_t));238 c = translate(ev->key, map_lcase, sizeof(map_lcase) / sizeof(char32_t)); 239 239 240 240 if (c != 0) … … 242 242 243 243 if ((ev->mods & KM_SHIFT) != 0) 244 c = translate(ev->key, map_shifted, sizeof(map_shifted) / sizeof( wchar_t));244 c = translate(ev->key, map_shifted, sizeof(map_shifted) / sizeof(char32_t)); 245 245 else 246 c = translate(ev->key, map_not_shifted, sizeof(map_not_shifted) / sizeof( wchar_t));246 c = translate(ev->key, map_not_shifted, sizeof(map_not_shifted) / sizeof(char32_t)); 247 247 248 248 if (c != 0) … … 250 250 251 251 if ((ev->mods & KM_NUM_LOCK) != 0) 252 c = translate(ev->key, map_numeric, sizeof(map_numeric) / sizeof( wchar_t));252 c = translate(ev->key, map_numeric, sizeof(map_numeric) / sizeof(char32_t)); 253 253 else 254 254 c = 0;
Note:
See TracChangeset
for help on using the changeset viewer.