mirror of
https://github.com/TomHarte/CLK.git
synced 2025-01-11 08:30:55 +00:00
Ensures no-hat input doesn't override analogue axes.
This commit is contained in:
parent
6a73fe7d65
commit
6b2970f2f2
@ -190,14 +190,14 @@ struct ActivityObserver: public Activity::Observer {
|
|||||||
const float y_axis = joystick.axes[1].position;
|
const float y_axis = joystick.axes[1].position;
|
||||||
machine_joysticks[target]->set_input(Inputs::Joystick::Input(Inputs::Joystick::Input::Type::Vertical), y_axis);
|
machine_joysticks[target]->set_input(Inputs::Joystick::Input(Inputs::Joystick::Input::Type::Vertical), y_axis);
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
|
// Forward hats as directions; hats always override analogue inputs.
|
||||||
// Forward hats as directions; hats always override analogue inputs.
|
for(CSJoystickHat *hat in joystick.hats) {
|
||||||
for(CSJoystickHat *hat in joystick.hats) {
|
machine_joysticks[target]->set_input(Inputs::Joystick::Input(Inputs::Joystick::Input::Type::Up), !!(hat.direction & CSJoystickHatDirectionUp));
|
||||||
machine_joysticks[target]->set_input(Inputs::Joystick::Input(Inputs::Joystick::Input::Type::Up), !!(hat.direction & CSJoystickHatDirectionUp));
|
machine_joysticks[target]->set_input(Inputs::Joystick::Input(Inputs::Joystick::Input::Type::Down), !!(hat.direction & CSJoystickHatDirectionDown));
|
||||||
machine_joysticks[target]->set_input(Inputs::Joystick::Input(Inputs::Joystick::Input::Type::Down), !!(hat.direction & CSJoystickHatDirectionDown));
|
machine_joysticks[target]->set_input(Inputs::Joystick::Input(Inputs::Joystick::Input::Type::Left), !!(hat.direction & CSJoystickHatDirectionLeft));
|
||||||
machine_joysticks[target]->set_input(Inputs::Joystick::Input(Inputs::Joystick::Input::Type::Left), !!(hat.direction & CSJoystickHatDirectionLeft));
|
machine_joysticks[target]->set_input(Inputs::Joystick::Input(Inputs::Joystick::Input::Type::Right), !!(hat.direction & CSJoystickHatDirectionRight));
|
||||||
machine_joysticks[target]->set_input(Inputs::Joystick::Input(Inputs::Joystick::Input::Type::Right), !!(hat.direction & CSJoystickHatDirectionRight));
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Forward all fire buttons, mapping as a function of index.
|
// Forward all fire buttons, mapping as a function of index.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user