Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/usbhid/kbddev.h

    rdfe53af r5050d9e  
    3939#include <stdint.h>
    4040
    41 #include <fibril_synch.h>
    42 
    4341#include <usb/classes/hid.h>
     42#include <usb/classes/hidparser.h>
    4443#include <ddf/driver.h>
    4544#include <usb/pipes.h>
     
    4847
    4948/*----------------------------------------------------------------------------*/
     49
    5050/**
    51  * Structure for keeping information needed for auto-repeat of keys.
     51 * @brief USB/HID keyboard device type.
    5252 */
    5353typedef 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;
    63 
    64 /**
    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.
    75  */
    76 typedef struct {
    77         /** Structure holding generic USB/HID device information. */
    7854        usbhid_dev_t *hid_dev;
    7955       
    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). */
     56        uint8_t *keycodes;
     57        size_t keycode_count;
    8558        uint8_t modifiers;
    8659       
    87         /** Currently active modifiers including locks. Sent to the console. */
    8860        unsigned mods;
    89        
    90         /** Currently active lock keys. */
    9161        unsigned lock_keys;
    9262       
    93         /** IPC phone to the console device (for sending key events). */
    9463        int console_phone;
    9564       
    96         /** Information for auto-repeat of keys. */
    97         usbhid_kbd_repeat_t repeat;
     65        usb_hid_report_parser_t *parser;
    9866       
    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). */
    10367        int initialized;
    10468} usbhid_kbd_t;
     
    10872int usbhid_kbd_try_add_device(ddf_dev_t *dev);
    10973
    110 void usbhid_kbd_push_ev(usbhid_kbd_t *kbd_dev, int type, unsigned int key);
    111 
    11274#endif /* USBHID_KBDDEV_H_ */
    11375
Note: See TracChangeset for help on using the changeset viewer.