Changeset 12b6796 in mainline for uspace/srv/kbd/generic/kbd.c
- Timestamp:
- 2009-02-20T22:47:08Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 5ad8661
- Parents:
- 90e3d6a
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/kbd/generic/kbd.c
r90e3d6a r12b6796 64 64 static unsigned mods = KM_NUM_LOCK; 65 65 66 /** Currently pressed lock keys. We track these to tackle autorepeat. */ 67 static unsigned lock_keys; 68 66 69 void kbd_push_scancode(int scancode) 67 70 { … … 99 102 } 100 103 101 if (mod_mask != 0 && type == KE_PRESS) 102 mods = mods ^ mod_mask; 104 if (mod_mask != 0) { 105 if (type == KE_PRESS) { 106 /* 107 * Only change lock state on transition from released 108 * to pressed. This prevents autorepeat from messing 109 * up the lock state. 110 */ 111 mods = mods ^ (mod_mask & ~lock_keys); 112 lock_keys = lock_keys | mod_mask; 113 } else { 114 lock_keys = lock_keys & ~mod_mask; 115 } 116 } 103 117 104 118 printf("type: %d\n", type);
Note:
See TracChangeset
for help on using the changeset viewer.