|
@@ -21,11 +21,11 @@ class X52;
|
21
|
21
|
class JoystickEvents {
|
22
|
22
|
public:
|
23
|
23
|
JoystickEvents(JoystickEvents* _client = 0) : client(_client) { }
|
24
|
|
- virtual void OnGamePadChanged(const GamePadEventData& evt) = 0;
|
25
|
|
- virtual void OnHatSwitch(uint8_t hat) = 0;
|
26
|
|
- virtual void OnButtonUp(uint8_t but_id) = 0;
|
27
|
|
- virtual void OnButtonDown(uint8_t but_id) = 0;
|
28
|
|
- virtual void OnMouseMoved(uint8_t x, uint8_t y) = 0;
|
|
24
|
+ virtual void OnGamePadChanged(const GamePadEventData& evt) { if (client) client->OnGamePadChanged(evt); }
|
|
25
|
+ virtual void OnHatSwitch(uint8_t hat) { if(client) client->OnHatSwitch(hat); }
|
|
26
|
+ virtual void OnButtonUp(uint8_t but_id) { if(client) client->OnButtonUp(but_id); }
|
|
27
|
+ virtual void OnButtonDown(uint8_t but_id) { if(client) client->OnButtonDown(but_id); }
|
|
28
|
+ virtual void OnMouseMoved(uint8_t x, uint8_t y) { if (client) client->OnMouseMoved(x, y); }
|
29
|
29
|
|
30
|
30
|
protected:
|
31
|
31
|
JoystickEvents* client;
|
|
@@ -35,9 +35,6 @@ class JoystickEventsDeadZone : public JoystickEvents {
|
35
|
35
|
public:
|
36
|
36
|
JoystickEventsDeadZone(JoystickEvents* client = 0) : JoystickEvents(client) { }
|
37
|
37
|
virtual void OnGamePadChanged(const GamePadEventData& evt);
|
38
|
|
- virtual void OnHatSwitch(uint8_t hat);
|
39
|
|
- virtual void OnButtonUp(uint8_t but_id);
|
40
|
|
- virtual void OnButtonDown(uint8_t but_id);
|
41
|
38
|
virtual void OnMouseMoved(uint8_t x, uint8_t y);
|
42
|
39
|
|
43
|
40
|
private:
|
|
@@ -52,10 +49,6 @@ class JoystickEventsCPPM : public JoystickEvents {
|
52
|
49
|
public:
|
53
|
50
|
JoystickEventsCPPM(JoystickEvents* client = 0);
|
54
|
51
|
virtual void OnGamePadChanged(const GamePadEventData& evt);
|
55
|
|
- virtual void OnHatSwitch(uint8_t hat);
|
56
|
|
- virtual void OnButtonUp(uint8_t but_id);
|
57
|
|
- virtual void OnButtonDown(uint8_t but_id);
|
58
|
|
- virtual void OnMouseMoved(uint8_t x, uint8_t y);
|
59
|
52
|
|
60
|
53
|
private:
|
61
|
54
|
const static uint8_t channels = 12;
|
|
@@ -65,11 +58,7 @@ class JoystickEventsCPPM : public JoystickEvents {
|
65
|
58
|
class JoystickEventsButtons : public JoystickEvents {
|
66
|
59
|
public:
|
67
|
60
|
JoystickEventsButtons(X52* x = 0, JoystickEvents* client = 0);
|
68
|
|
- virtual void OnGamePadChanged(const GamePadEventData& evt);
|
69
|
|
- virtual void OnHatSwitch(uint8_t hat);
|
70
|
|
- virtual void OnButtonUp(uint8_t but_id);
|
71
|
61
|
virtual void OnButtonDown(uint8_t but_id);
|
72
|
|
- virtual void OnMouseMoved(uint8_t x, uint8_t y);
|
73
|
62
|
|
74
|
63
|
private:
|
75
|
64
|
enum MenuState {
|