Changeset bff90ba in mainline
- Timestamp:
- 2011-12-27T11:36:08Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- da2d75b
- Parents:
- a84ddf0
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/char/xtkbd/xtkbd.c
ra84ddf0 rbff90ba 179 179 /*----------------------------------------------------------------------------*/ 180 180 static int polling(void *); 181 static void default_connection_handler(ddf_fun_t *fun, 182 ipc_callid_t icallid, ipc_call_t *icall); 181 static void default_connection_handler(ddf_fun_t *, ipc_callid_t, ipc_call_t *); 183 182 /*----------------------------------------------------------------------------*/ 184 183 /** Keyboard function ops. */ … … 241 240 { 242 241 assert(arg); 243 xt_kbd_t *kbd = arg;242 const xt_kbd_t *kbd = arg; 244 243 245 244 assert(kbd->parent_sess); … … 255 254 map_size = sizeof(scanmap_e0) / sizeof(int); 256 255 size = char_dev_read(kbd->parent_sess, &code, 1); 257 } 258 259 260 kbd_event_type_t type; 261 if (code & 0x80) { 262 code &= ~0x80; 263 type = KEY_RELEASE; 264 } else { 265 type = KEY_PRESS; 266 } 267 268 if ((size_t) code >= map_size) { 269 ddf_msg(LVL_WARN, 270 "Unknown scancode: %hhx, size: %zd", code, size); 256 // TODO handle print screen 257 } 258 259 /* Invalid read. */ 260 if (size != 1) { 271 261 continue; 272 262 } 273 263 274 const unsigned key = map[code]; 264 265 /* Bit 7 indicates press/release */ 266 const kbd_event_type_t type = 267 (code & 0x80) ? KEY_RELEASE : KEY_PRESS; 268 code &= ~0x80; 269 270 const unsigned key = (code < map_size) ? map[code] : 0; 275 271 if (key != 0) { 276 272 async_exch_t *exch = … … 283 279 async_msg_4(exch, KBDEV_EVENT, type, key, 0, 0); 284 280 async_exchange_end(exch); 281 } else { 282 ddf_msg(LVL_WARN, "Unknown scancode: %hhx", code); 285 283 } 286 284 }
Note:
See TracChangeset
for help on using the changeset viewer.