Improved support for joystick buttons.
git-svn-id: https://svn.code.sf.net/p/extremetuxracer/code/trunk@646 0420edf4-82e4-42fc-9478-35b55e6d67a3master
parent
c2458aeb3a
commit
5498c13d76
|
@ -159,11 +159,20 @@ void CRacing::Jaxis(int axis, float value) {
|
|||
}
|
||||
}
|
||||
|
||||
void CRacing::Jbutt(int button, int state) {
|
||||
if (button == 0) {
|
||||
key_charging = state != 0;
|
||||
} else if (button == 1) {
|
||||
// key_charging = (bool) state;
|
||||
void CRacing::Jbutt(int button, bool pressed) {
|
||||
switch (button) {
|
||||
case 0:
|
||||
key_paddling = pressed;
|
||||
break;
|
||||
case 1:
|
||||
trick_modifier = pressed;
|
||||
break;
|
||||
case 2:
|
||||
key_braking = pressed;
|
||||
break;
|
||||
case 3:
|
||||
key_charging = pressed;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ class CRacing : public State {
|
|||
void Loop(float time_step);
|
||||
void Keyb(sf::Keyboard::Key key, bool release, int x, int y);
|
||||
void Jaxis(int axis, float value);
|
||||
void Jbutt(int button, int state);
|
||||
void Jbutt(int button, bool pressed);
|
||||
void Exit();
|
||||
public:
|
||||
};
|
||||
|
|
|
@ -61,7 +61,7 @@ public:
|
|||
virtual void Mouse(int button, int state, int x, int y) {}
|
||||
virtual void Motion(int x, int y) {}
|
||||
virtual void Jaxis(int axis, float value) {}
|
||||
virtual void Jbutt(int button, int state) {}
|
||||
virtual void Jbutt(int button, bool pressed) {}
|
||||
virtual void TextEntered(char text) {}
|
||||
virtual void Exit() {}
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue