summaryrefslogtreecommitdiff
path: root/event_action.h
blob: ea51cfe87bd44e0d91e21f8efeb673169978babe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/*
 * gamepad.c: A plugin for the Video Disk Recorder
 *
 * See the README file for copyright information and how to reach the author.
 *
 * $Id$
 */
#ifndef EVENT_ACTION_H
#define EVENT_ACTION_H

#include <vdr/remote.h>
#include "gamepad_handler.h"

class cEventAction
{
private:
    cGamepadHandler::event_type state;
    const eKeys key;
    const bool autorepeat;
    uint64_t lastEventTime;
    const int repeatTime;
    const int repeatHold;

    inline void fire(void);

public:
    cEventAction(eKeys _key, bool _autorepeat = false, int repeatTimeMs = 100, int repeatStartHoldMs = 300);
    void event(cGamepadHandler::generic_event *event);
    void repeat();
};

#endif