Changeset e69f10b in mainline for uspace/drv/usbhid/kbddev.h


Ignore:
Timestamp:
2011-03-10T19:07:11Z (13 years ago)
Author:
Lubos Slovak <lubos.slovak@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a8def7d
Parents:
7351dc3 (diff), 45dd8bf (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.
Message:

Merged changes from lelian/hidd

File:
1 edited

Legend:

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

    r7351dc3 re69f10b  
    3939#include <stdint.h>
    4040
     41#include <fibril_synch.h>
     42
    4143#include <usb/classes/hid.h>
    4244#include <usb/classes/hidparser.h>
     
    4749
    4850/*----------------------------------------------------------------------------*/
     51/**
     52 * Structure for keeping information needed for auto-repeat of keys.
     53 */
     54typedef struct {
     55        /** Last pressed key. */
     56        unsigned int key_new;
     57        /** Key to be repeated. */
     58        unsigned int key_repeated;
     59        /** Delay before first repeat in microseconds. */
     60        unsigned int delay_before;
     61        /** Delay between repeats in microseconds. */
     62        unsigned int delay_between;
     63} usbhid_kbd_repeat_t;
    4964
    5065/**
    51  * @brief USB/HID keyboard device type.
     66 * USB/HID keyboard device type.
     67 *
     68 * Holds a reference to generic USB/HID device structure and keyboard-specific
     69 * data, such as currently pressed keys, modifiers and lock keys.
     70 *
     71 * Also holds a IPC phone to the console (since there is now no other way to
     72 * communicate with it).
     73 *
     74 * @note Storing active lock keys in this structure results in their setting
     75 *       being device-specific.
    5276 */
    5377typedef struct {
     78        /** Structure holding generic USB/HID device information. */
    5479        usbhid_dev_t *hid_dev;
    5580       
    56         uint8_t *keycodes;
    57         size_t keycode_count;
     81        /** Currently pressed keys (not translated to key codes). */
     82        uint8_t *keys;
     83        /** Count of stored keys (i.e. number of keys in the report). */
     84        size_t key_count;
     85        /** Currently pressed modifiers (bitmap). */
    5886        uint8_t modifiers;
    5987       
     88        /** Currently active modifiers including locks. Sent to the console. */
    6089        unsigned mods;
     90       
     91        /** Currently active lock keys. */
    6192        unsigned lock_keys;
    6293       
     94        /** IPC phone to the console device (for sending key events). */
    6395        int console_phone;
    6496       
     97        /** Information for auto-repeat of keys. */
     98        usbhid_kbd_repeat_t repeat;
     99       
     100        /** Mutex for accessing the information about auto-repeat. */
     101        fibril_mutex_t *repeat_mtx;
     102
    65103        usb_hid_report_parser_t *parser;
    66104       
     105        /** State of the structure (for checking before use). */
    67106        int initialized;
    68107} usbhid_kbd_t;
     
    72111int usbhid_kbd_try_add_device(ddf_dev_t *dev);
    73112
     113void usbhid_kbd_push_ev(usbhid_kbd_t *kbd_dev, int type, unsigned int key);
     114
    74115#endif /* USBHID_KBDDEV_H_ */
    75116
Note: See TracChangeset for help on using the changeset viewer.