Changeset a412d59f in mainline for uspace/srv/hid/input/input.c
- Timestamp:
- 2019-11-09T12:55:24Z (5 years ago)
- Parents:
- e18f0c0
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/hid/input/input.c
re18f0c0 ra412d59f 66 66 #include "serial.h" 67 67 68 #define NUM_LAYOUTS 468 #define NUM_LAYOUTS 5 69 69 70 70 static layout_ops_t *layout[NUM_LAYOUTS] = { … … 72 72 &us_dvorak_ops, 73 73 &cz_ops, 74 &ar_ops 74 &ar_ops, 75 &fr_azerty_ops 75 76 }; 76 77 … … 208 209 // TODO: More elegant layout switching 209 210 210 if ((type == KEY_PRESS) && (kdev->mods & KM_LCTRL) && 211 (key == KC_F1)) { 212 layout_destroy(kdev->active_layout); 213 kdev->active_layout = layout_create(layout[0]); 214 return; 215 } 216 217 if ((type == KEY_PRESS) && (kdev->mods & KM_LCTRL) && 218 (key == KC_F2)) { 219 layout_destroy(kdev->active_layout); 220 kdev->active_layout = layout_create(layout[1]); 221 return; 222 } 223 224 if ((type == KEY_PRESS) && (kdev->mods & KM_LCTRL) && 225 (key == KC_F3)) { 226 layout_destroy(kdev->active_layout); 227 kdev->active_layout = layout_create(layout[2]); 228 return; 229 } 230 231 if ((type == KEY_PRESS) && (kdev->mods & KM_LCTRL) && 232 (key == KC_F4)) { 233 layout_destroy(kdev->active_layout); 234 kdev->active_layout = layout_create(layout[3]); 235 return; 211 if ((type == KEY_PRESS) && (kdev->mods & KM_LCTRL)) { 212 switch (key) { 213 case KC_F1: 214 layout_destroy(kdev->active_layout); 215 kdev->active_layout = layout_create(layout[0]); 216 break; 217 case KC_F2: 218 layout_destroy(kdev->active_layout); 219 kdev->active_layout = layout_create(layout[1]); 220 break; 221 case KC_F3: 222 layout_destroy(kdev->active_layout); 223 kdev->active_layout = layout_create(layout[2]); 224 break; 225 case KC_F4: 226 layout_destroy(kdev->active_layout); 227 kdev->active_layout = layout_create(layout[3]); 228 break; 229 case KC_F5: 230 layout_destroy(kdev->active_layout); 231 kdev->active_layout = layout_create(layout[4]); 232 break; 233 default: // default: is here to avoid compiler warning about unhandled cases 234 break; 235 } 236 236 } 237 237
Note:
See TracChangeset
for help on using the changeset viewer.