Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/usbhid/kbdrepeat.c

    r7309799 rdfe53af  
    4545#include "kbddev.h"
    4646
    47 
    48 /** Delay between auto-repeat state checks when no key is being repeated. */
    49 static unsigned int CHECK_DELAY = 10000;
     47static unsigned int CHECK_DELAY = 1000;
    5048
    5149/*----------------------------------------------------------------------------*/
    52 /**
    53  * Main loop handling the auto-repeat of keys.
    54  *
    55  * This functions periodically checks if there is some key to be auto-repeated.
    56  *
    57  * If a new key is to be repeated, it uses the delay before first repeat stored
    58  * in the keyboard structure to wait until the key has to start repeating.
    59  *
    60  * If the same key is still pressed, it uses the delay between repeats stored
    61  * in the keyboard structure to wait until the key should be repeated.
    62  *
    63  * If the currently repeated key is not pressed any more (
    64  * usbhid_kbd_repeat_stop() was called), it stops repeating it and starts
    65  * checking again.
    66  *
    67  * @note For accessing the keyboard device auto-repeat information a fibril
    68  *       mutex (repeat_mtx) from the @a kbd structure is used.
    69  *
    70  * @param kbd Keyboard device structure.
    71  */
     50
    7251static void usbhid_kbd_repeat_loop(usbhid_kbd_t *kbd)
    7352{
     
    10786
    10887/*----------------------------------------------------------------------------*/
    109 /**
    110  * Main routine to be executed by a fibril for handling auto-repeat.
    111  *
    112  * Starts the loop for checking changes in auto-repeat.
    113  *
    114  * @param arg User-specified argument. Expects pointer to the keyboard device
    115  *            structure representing the keyboard.
    116  *
    117  * @retval EOK if the routine has finished.
    118  * @retval EINVAL if no argument is supplied.
    119  */
     88
    12089int usbhid_kbd_repeat_fibril(void *arg)
    12190{
     
    135104
    136105/*----------------------------------------------------------------------------*/
    137 /**
    138  * Start repeating particular key.
    139  *
    140  * @note Only one key is repeated at any time, so calling this function
    141  *       effectively cancels auto-repeat of the current repeated key (if any)
    142  *       and 'schedules' another key for auto-repeat.
    143  *
    144  * @param kbd Keyboard device structure.
    145  * @param key Key to start repeating.
    146  */
     106
    147107void usbhid_kbd_repeat_start(usbhid_kbd_t *kbd, unsigned int key)
    148108{
     
    153113
    154114/*----------------------------------------------------------------------------*/
    155 /**
    156  * Stop repeating particular key.
    157  *
    158  * @note Only one key is repeated at any time, but this function may be called
    159  *       even with key that is not currently repeated (in that case nothing
    160  *       happens).
    161  *
    162  * @param kbd Keyboard device structure.
    163  * @param key Key to stop repeating.
    164  */
     115
    165116void usbhid_kbd_repeat_stop(usbhid_kbd_t *kbd, unsigned int key)
    166117{
Note: See TracChangeset for help on using the changeset viewer.