Changeset 72af8da in mainline for uspace/drv/usbhid/kbddev.h
- Timestamp:
- 2011-03-16T18:50:17Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 42a3a57
- Parents:
- 3e7b7cd (diff), fcf07e6 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/usbhid/kbddev.h
r3e7b7cd r72af8da 39 39 #include <stdint.h> 40 40 41 #include <fibril_synch.h> 42 41 43 #include <usb/classes/hid.h> 42 44 #include <ddf/driver.h> … … 46 48 47 49 /*----------------------------------------------------------------------------*/ 50 /** 51 * Structure for keeping information needed for auto-repeat of keys. 52 */ 53 typedef struct { 54 /** Last pressed key. */ 55 unsigned int key_new; 56 /** Key to be repeated. */ 57 unsigned int key_repeated; 58 /** Delay before first repeat in microseconds. */ 59 unsigned int delay_before; 60 /** Delay between repeats in microseconds. */ 61 unsigned int delay_between; 62 } usbhid_kbd_repeat_t; 48 63 49 64 /** 50 * @brief USB/HID keyboard device type. 65 * USB/HID keyboard device type. 66 * 67 * Holds a reference to generic USB/HID device structure and keyboard-specific 68 * data, such as currently pressed keys, modifiers and lock keys. 69 * 70 * Also holds a IPC phone to the console (since there is now no other way to 71 * communicate with it). 72 * 73 * @note Storing active lock keys in this structure results in their setting 74 * being device-specific. 51 75 */ 52 76 typedef struct { 77 /** Structure holding generic USB/HID device information. */ 53 78 usbhid_dev_t *hid_dev; 54 79 55 uint8_t *keycodes; 56 size_t keycode_count; 80 /** Currently pressed keys (not translated to key codes). */ 81 uint8_t *keys; 82 /** Count of stored keys (i.e. number of keys in the report). */ 83 size_t key_count; 84 /** Currently pressed modifiers (bitmap). */ 57 85 uint8_t modifiers; 58 86 87 /** Currently active modifiers including locks. Sent to the console. */ 59 88 unsigned mods; 89 90 /** Currently active lock keys. */ 60 91 unsigned lock_keys; 61 92 93 /** IPC phone to the console device (for sending key events). */ 62 94 int console_phone; 63 95 96 /** Information for auto-repeat of keys. */ 97 usbhid_kbd_repeat_t repeat; 98 99 /** Mutex for accessing the information about auto-repeat. */ 100 fibril_mutex_t *repeat_mtx; 101 102 /** State of the structure (for checking before use). */ 64 103 int initialized; 65 104 } usbhid_kbd_t; … … 69 108 int usbhid_kbd_try_add_device(ddf_dev_t *dev); 70 109 110 void usbhid_kbd_push_ev(usbhid_kbd_t *kbd_dev, int type, unsigned int key); 111 71 112 #endif /* USBHID_KBDDEV_H_ */ 72 113
Note:
See TracChangeset
for help on using the changeset viewer.