forked from zvxryb/Linux-Virtual-Joystick
-
Notifications
You must be signed in to change notification settings - Fork 2
/
vjoy.h
50 lines (37 loc) · 813 Bytes
/
vjoy.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
#ifndef _VJOY_H
#define _VJOY_H
#include <linux/input.h>
#include <linux/uinput.h>
#include <cstring>
#include <cstdlib>
#include <vector>
#include <map>
#include <string>
#include <exception>
#include "device.h"
#include "python_include.h"
//error handling mechanism
class error: public std::exception {
private:
std::string problem;
public:
error(const std::string& message) throw () :
problem(message) {
}
virtual ~error() throw () {
}
virtual const char* what() throw () {
return problem.c_str();
}
};
PyObject* convert_ff_effect(struct ff_effect* effect);
PyObject* convert_ff_envelope(struct ff_envelope *envelope);
class vjoy {
public:
static pthread_mutex_t pymutex;
static void init(const char* extraPath);
static void end() {
delete device::dev;
}
};
#endif /* _VJOY_H */