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


Ignore:
Timestamp:
2011-03-10T10:47:55Z (14 years ago)
Author:
Lubos Slovak <lubos.slovak@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
17ada7a, 8a02ff3
Parents:
269bd9b4
Message:

Auto-repeat of keys.

  • Added structure usbhid_kbd_repeat_t.
  • Added functions for:
    • checking repeat status in a loop
    • starting to repeat a key
    • stopping to repeat a key
File:
1 edited

Legend:

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

    r269bd9b4 rdfe53af  
    3939#include <stdint.h>
    4040
     41#include <fibril_synch.h>
     42
    4143#include <usb/classes/hid.h>
    4244#include <ddf/driver.h>
     
    4648
    4749/*----------------------------------------------------------------------------*/
     50/**
     51 * Structure for keeping information needed for auto-repeat of keys.
     52 */
     53typedef 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
    4864/**
    4965 * USB/HID keyboard device type.
     
    7894        int console_phone;
    7995       
     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       
    80102        /** State of the structure (for checking before use). */
    81103        int initialized;
     
    86108int usbhid_kbd_try_add_device(ddf_dev_t *dev);
    87109
     110void usbhid_kbd_push_ev(usbhid_kbd_t *kbd_dev, int type, unsigned int key);
     111
    88112#endif /* USBHID_KBDDEV_H_ */
    89113
Note: See TracChangeset for help on using the changeset viewer.