Changeset 0175246 in mainline for uspace/srv/kbd/generic/kbd.c
- Timestamp:
- 2009-04-05T16:20:02Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade
- Children:
- 482c86f
- Parents:
- 56fa418
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/kbd/generic/kbd.c
r56fa418 r0175246 71 71 int cir_phone = -1; 72 72 73 #define NUM_LAYOUTS 3 74 75 static layout_op_t *layout[NUM_LAYOUTS] = { 76 &us_qwerty_op, 77 &us_dvorak_op, 78 &cz_op 79 }; 80 81 static int active_layout = 0; 82 73 83 void kbd_push_scancode(int scancode) 74 84 { … … 124 134 printf("keycode: %u\n", key); 125 135 */ 136 if (type == KE_PRESS && (mods & KM_LCTRL) && 137 key == KC_F1) { 138 active_layout = 0; 139 return; 140 } 141 142 if (type == KE_PRESS && (mods & KM_LCTRL) && 143 key == KC_F2) { 144 active_layout = 1; 145 return; 146 } 147 148 if (type == KE_PRESS && (mods & KM_LCTRL) && 149 key == KC_F3) { 150 active_layout = 2; 151 return; 152 } 153 126 154 ev.type = type; 127 155 ev.key = key; 128 156 ev.mods = mods; 129 157 130 ev.c = layout _parse_ev(&ev);158 ev.c = layout[active_layout]->parse_ev(&ev); 131 159 132 160 async_msg_4(phone2cons, KBD_EVENT, ev.type, ev.key, ev.mods, ev.c);
Note:
See TracChangeset
for help on using the changeset viewer.