Changeset 453c5ce in mainline
- Timestamp:
- 2019-11-09T19:06:16Z (5 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- e1abc964
- Parents:
- e18f0c0
- git-author:
- CHTCHEGLOV Ilia <chtcheglov.ilia@…> (2019-11-09 12:55:24)
- git-committer:
- Jakub Jermář <jakub@…> (2019-11-09 19:06:16)
- Location:
- uspace/srv/hid/input
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/hid/input/input.c
re18f0c0 r453c5ce 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 -
uspace/srv/hid/input/layout.h
re18f0c0 r453c5ce 60 60 extern layout_ops_t cz_ops; 61 61 extern layout_ops_t ar_ops; 62 extern layout_ops_t fr_azerty_ops; 62 63 63 64 extern layout_t *layout_create(layout_ops_t *); -
uspace/srv/hid/input/meson.build
re18f0c0 r453c5ce 31 31 src = files( 32 32 'layout/cz.c', 33 'layout/fr_azerty.c', 33 34 'layout/us_qwerty.c', 34 35 'layout/us_dvorak.c',
Note:
See TracChangeset
for help on using the changeset viewer.