Changeset 9db4079 in mainline for uspace/srv/kbd/layout/us_dvorak.c
- Timestamp:
- 2009-04-05T09:27:12Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade
- Children:
- cee8d3e
- Parents:
- b27eb71
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/kbd/layout/us_dvorak.c
rb27eb71 r9db4079 37 37 #include <layout.h> 38 38 39 static charmap_lcase[] = {39 static wchar_t map_lcase[] = { 40 40 [KC_R] = 'p', 41 41 [KC_T] = 'y', … … 70 70 }; 71 71 72 static charmap_ucase[] = {72 static wchar_t map_ucase[] = { 73 73 [KC_R] = 'P', 74 74 [KC_T] = 'Y', … … 103 103 }; 104 104 105 static charmap_not_shifted[] = {105 static wchar_t map_not_shifted[] = { 106 106 [KC_BACKTICK] = '`', 107 107 … … 133 133 }; 134 134 135 static charmap_shifted[] = {135 static wchar_t map_shifted[] = { 136 136 [KC_BACKTICK] = '~', 137 137 … … 163 163 }; 164 164 165 static charmap_neutral[] = {165 static wchar_t map_neutral[] = { 166 166 [KC_BACKSPACE] = '\b', 167 167 [KC_TAB] = '\t', … … 176 176 }; 177 177 178 static charmap_numeric[] = {178 static wchar_t map_numeric[] = { 179 179 [KC_N7] = '7', 180 180 [KC_N8] = '8', … … 191 191 }; 192 192 193 static int translate(unsigned int key, char*map, size_t map_length)193 static wchar_t translate(unsigned int key, wchar_t *map, size_t map_length) 194 194 { 195 195 if (key >= map_length) … … 198 198 } 199 199 200 charlayout_parse_ev(kbd_event_t *ev)200 wchar_t layout_parse_ev(kbd_event_t *ev) 201 201 { 202 charc;202 wchar_t c; 203 203 204 204 /* Produce no characters when Ctrl or Alt is pressed. */ … … 206 206 return 0; 207 207 208 c = translate(ev->key, map_neutral, sizeof(map_neutral) / sizeof( char));208 c = translate(ev->key, map_neutral, sizeof(map_neutral) / sizeof(wchar_t)); 209 209 if (c != 0) 210 210 return c; 211 211 212 212 if (((ev->mods & KM_SHIFT) != 0) ^ ((ev->mods & KM_CAPS_LOCK) != 0)) 213 c = translate(ev->key, map_ucase, sizeof(map_ucase) / sizeof( char));213 c = translate(ev->key, map_ucase, sizeof(map_ucase) / sizeof(wchar_t)); 214 214 else 215 c = translate(ev->key, map_lcase, sizeof(map_lcase) / sizeof( char));215 c = translate(ev->key, map_lcase, sizeof(map_lcase) / sizeof(wchar_t)); 216 216 217 217 if (c != 0) … … 219 219 220 220 if ((ev->mods & KM_SHIFT) != 0) 221 c = translate(ev->key, map_shifted, sizeof(map_shifted) / sizeof( char));221 c = translate(ev->key, map_shifted, sizeof(map_shifted) / sizeof(wchar_t)); 222 222 else 223 c = translate(ev->key, map_not_shifted, sizeof(map_not_shifted) / sizeof( char));223 c = translate(ev->key, map_not_shifted, sizeof(map_not_shifted) / sizeof(wchar_t)); 224 224 225 225 if (c != 0) … … 227 227 228 228 if ((ev->mods & KM_NUM_LOCK) != 0) 229 c = translate(ev->key, map_numeric, sizeof(map_numeric) / sizeof( char));229 c = translate(ev->key, map_numeric, sizeof(map_numeric) / sizeof(wchar_t)); 230 230 else 231 231 c = 0;
Note:
See TracChangeset
for help on using the changeset viewer.