Changeset 54e682f in mainline
- Timestamp:
- 2011-02-25T10:22:48Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 0475e13
- Parents:
- d972534
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/usbhid/main.c
rd972534 r54e682f 252 252 253 253 switch (key) { 254 case KC_CAPS_LOCK: mod_mask = KM_CAPS_LOCK; usb_log_debug ("\n\nPushing CAPS LOCK! (mask: %u)\n\n", mod_mask); break;255 case KC_NUM_LOCK: mod_mask = KM_NUM_LOCK; usb_log_debug ("\n\nPushing NUM LOCK! (mask: %u)\n\n", mod_mask); break;256 case KC_SCROLL_LOCK: mod_mask = KM_SCROLL_LOCK; usb_log_debug ("\n\nPushing SCROLL LOCK! (mask: %u)\n\n", mod_mask); break;254 case KC_CAPS_LOCK: mod_mask = KM_CAPS_LOCK; usb_log_debug2("\n\nPushing CAPS LOCK! (mask: %u)\n\n", mod_mask); break; 255 case KC_NUM_LOCK: mod_mask = KM_NUM_LOCK; usb_log_debug2("\n\nPushing NUM LOCK! (mask: %u)\n\n", mod_mask); break; 256 case KC_SCROLL_LOCK: mod_mask = KM_SCROLL_LOCK; usb_log_debug2("\n\nPushing SCROLL LOCK! (mask: %u)\n\n", mod_mask); break; 257 257 default: mod_mask = 0; break; 258 258 } 259 259 260 260 if (mod_mask != 0) { 261 usb_log_debug ("\n\nChanging mods and lock keys\n\n");262 usb_log_debug ("\n\nmods before: 0x%x\n\n", mods);263 usb_log_debug ("\n\nLock keys before:0x%x\n\n", lock_keys);261 usb_log_debug2("\n\nChanging mods and lock keys\n"); 262 usb_log_debug2("\nmods before: 0x%x\n", mods); 263 usb_log_debug2("\nLock keys before:0x%x\n\n", lock_keys); 264 264 265 265 if (type == KEY_PRESS) { 266 usb_log_debug2("\nKey pressed.\n"); 266 267 /* 267 268 * Only change lock state on transition from released … … 275 276 usbkbd_set_led(mods, kbd_dev); 276 277 } else { 278 usb_log_debug2("\nKey released.\n"); 277 279 lock_keys = lock_keys & ~mod_mask; 278 280 } … … 283 285 usb_log_debug2("keycode: %u\n", key); 284 286 */ 285 usb_log_debug ("\n\nmods after: 0x%x\n\n", mods);286 usb_log_debug ("\n\nLock keys after: 0x%x\n\n", lock_keys);287 usb_log_debug2("\n\nmods after: 0x%x\n", mods); 288 usb_log_debug2("\nLock keys after: 0x%x\n\n", lock_keys); 287 289 288 290 if (type == KEY_PRESS && (mods & KM_LCTRL) && … … 317 319 ev.c = layout[active_layout]->parse_ev(&ev); 318 320 319 usb_log_debug ("Sending key %d to the console\n", ev.key);321 usb_log_debug2("Sending key %d to the console\n", ev.key); 320 322 assert(console_callback_phone != -1); 321 323 async_msg_4(console_callback_phone, KBD_EVENT, ev.type, ev.key, … … 375 377 } // no change 376 378 } 379 380 kbd_dev->modifiers = modifiers; 377 381 } 378 382 … … 393 397 while (i < kbd_dev->keycode_count 394 398 && key_codes[i] != kbd_dev->keycodes[j]) { 395 ++ j;399 ++i; 396 400 } 397 401 398 if ( j== kbd_dev->keycode_count) {402 if (i == kbd_dev->keycode_count) { 399 403 // not found, i.e. the key was released 400 404 key = usbkbd_parse_scancode(kbd_dev->keycodes[j]); 401 405 kbd_push_ev(KEY_RELEASE, key, kbd_dev); 406 usb_log_debug2("\nKey released: %d\n", key); 402 407 } else { 403 408 // found, nothing happens … … 414 419 } 415 420 416 assert(kbd_dev->keycode_count <= kbd_dev->keycode_count);417 418 421 if (j == kbd_dev->keycode_count) { 419 422 // not found, i.e. new key pressed 420 423 key = usbkbd_parse_scancode(key_codes[i]); 424 usb_log_debug2("\nKey pressed: %d (keycode: %d)\n", key, 425 key_codes[i]); 421 426 kbd_push_ev(KEY_PRESS, key, kbd_dev); 422 427 } else { 423 428 // found, nothing happens 424 429 } 430 } 431 432 memcpy(kbd_dev->keycodes, key_codes, kbd_dev->keycode_count); 433 434 usb_log_debug2("\nNew stored keycodes: "); 435 for (i = 0; i < kbd_dev->keycode_count; ++i) { 436 usb_log_debug2("%d ", kbd_dev->keycodes[i]); 425 437 } 426 438 }
Note:
See TracChangeset
for help on using the changeset viewer.