示例#1
0
def dispatcher():
    done = exiting
    while not done:
        sleep(0.001)
        with lock:
            done = exiting
            current = time()
            for k, v in down_keys.items():
                if current > v:
                    print 'key is: ', k
                    send_key(k, True, True)
                    down_keys[k] = time() + repeat_interval
                    print 'dispatching'
示例#2
0
def send_down(key, delay):
    with lock:
        send_key(key, True)
        down_keys[key] = delay
示例#3
0
def send_up(key):
    with lock:
        send_key(key, False)
        del down_keys[key]