forked from popcornmix/omxplayer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathKeyConfig.h
59 lines (51 loc) · 1.44 KB
/
KeyConfig.h
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#include <map>
#include <vector>
#include <string>
#include <sys/types.h>
#include <linux/joystick.h>
class KeyConfig{
public:
enum {
ACTION_DECREASE_SPEED = 1,
ACTION_INCREASE_SPEED,
ACTION_REWIND,
ACTION_FAST_FORWARD,
ACTION_SHOW_INFO,
ACTION_PREVIOUS_AUDIO,
ACTION_NEXT_AUDIO,
ACTION_PREVIOUS_CHAPTER,
ACTION_NEXT_CHAPTER,
ACTION_PREVIOUS_SUBTITLE,
ACTION_NEXT_SUBTITLE,
ACTION_TOGGLE_SUBTITLE,
ACTION_DECREASE_SUBTITLE_DELAY,
ACTION_INCREASE_SUBTITLE_DELAY,
ACTION_EXIT,
ACTION_PAUSE,
ACTION_DECREASE_VOLUME,
ACTION_INCREASE_VOLUME,
ACTION_SEEK_BACK_SMALL,
ACTION_SEEK_FORWARD_SMALL,
ACTION_SEEK_BACK_LARGE,
ACTION_SEEK_FORWARD_LARGE,
ACTION_STEP
};
#define KEY_LEFT_HEX 0x5b44
#define KEY_RIGHT_HEX 0x5b43
#define KEY_UP_HEX 0x5b41
#define KEY_DOWN_HEX 0x5b42
#define KEY_ESC_HEX 27
KeyConfig();
KeyConfig(char*);
int getAction(int key);
int getAction(std::string joystick, struct js_event *jse);
std::vector<std::string> getJoysticks(){ return joysticks; }
int getNumJoysticks(){ return joysticks.size(); }
private:
std::map<int, int> keymap;
std::map<std::string, int> jsmap;
std::vector<std::string> joysticks;
int num_joysticks;
void buildDefaultKeymap();
void parseConfigFile(char* filepath);
};