Changeset 8f840ed in mainline for uspace/drv/usbhid/main.c
- Timestamp:
- 2011-02-24T19:31:07Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f2ba5d9f
- Parents:
- e7b7ebd5
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/usbhid/main.c
re7b7ebd5 r8f840ed 139 139 */ 140 140 141 /** Currently active modifiers .141 /** Currently active modifiers (locks is probably better word). 142 142 * 143 143 * TODO: put to device? … … 258 258 */ 259 259 260 static const keycode_t usb_hid_modifiers_boot_keycodes[5] = { 261 KC_NUM_LOCK, /* USB_HID_MOD_BOOT_NUM_LOCK */ 262 KC_CAPS_LOCK, /* USB_HID_MOD_BOOT_CAPS_LOCK */ 263 KC_SCROLL_LOCK, /* USB_HID_MOD_BOOT_SCROLL_LOCK */ 264 0, /* USB_HID_MOD_BOOT_COMPOSE */ 265 0 /* USB_HID_MOD_BOOT_KANA */ 260 static const keycode_t usb_hid_modifiers_keycodes[USB_HID_MOD_COUNT] = { 261 KC_LCTRL, /* USB_HID_MOD_LCTRL */ 262 KC_LSHIFT, /* USB_HID_MOD_LSHIFT */ 263 KC_LALT, /* USB_HID_MOD_LALT */ 264 0, /* USB_HID_MOD_LGUI */ 265 KC_RCTRL, /* USB_HID_MOD_RCTRL */ 266 KC_RSHIFT, /* USB_HID_MOD_RSHIFT */ 267 KC_RALT, /* USB_HID_MOD_RALT */ 268 0, /* USB_HID_MOD_RGUI */ 266 269 }; 267 270 … … 279 282 280 283 int i; 281 for (i = 0; i < USB_HID_MOD_ BOOT_COUNT; ++i) {282 if ((modifiers & usb_hid_modifiers_ boot_consts[i]) &&283 !(kbd_dev->modifiers & usb_hid_modifiers_ boot_consts[i])) {284 for (i = 0; i < USB_HID_MOD_COUNT; ++i) { 285 if ((modifiers & usb_hid_modifiers_consts[i]) && 286 !(kbd_dev->modifiers & usb_hid_modifiers_consts[i])) { 284 287 // modifier pressed 285 if (usb_hid_modifiers_ boot_keycodes[i] != 0) {288 if (usb_hid_modifiers_keycodes[i] != 0) { 286 289 kbd_push_ev(KEY_PRESS, 287 usb_hid_modifiers_ boot_keycodes[i]);290 usb_hid_modifiers_keycodes[i]); 288 291 } 289 } else if (!(modifiers & usb_hid_modifiers_ boot_consts[i]) &&290 (kbd_dev->modifiers & usb_hid_modifiers_ boot_consts[i])) {292 } else if (!(modifiers & usb_hid_modifiers_consts[i]) && 293 (kbd_dev->modifiers & usb_hid_modifiers_consts[i])) { 291 294 // modifier released 292 if (usb_hid_modifiers_ boot_keycodes[i] != 0) {295 if (usb_hid_modifiers_keycodes[i] != 0) { 293 296 kbd_push_ev(KEY_RELEASE, 294 usb_hid_modifiers_ boot_keycodes[i]);297 usb_hid_modifiers_keycodes[i]); 295 298 } 296 299 } // no change
Note:
See TracChangeset
for help on using the changeset viewer.