mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-12-13 07:08:49 +00:00
Emulate motion controls with a mouse (#3122)
* Rework framework to allow for more types of mouse-to-something emulation and hook up gyro to it * Remove the unnecessary null check now that deltatime is handled differently * Fix toggle key * Basic gyro emulation working for two out of the three dimensions * clang * Added bindable key to hold for switching from looking to the sides to rolling * documentation
This commit is contained in:
@@ -66,6 +66,7 @@ auto output_array = std::array{
|
||||
ControllerOutput(LEFTJOYSTICK_HALFMODE),
|
||||
ControllerOutput(RIGHTJOYSTICK_HALFMODE),
|
||||
ControllerOutput(KEY_TOGGLE),
|
||||
ControllerOutput(MOUSE_GYRO_ROLL_MODE),
|
||||
|
||||
// Button mappings
|
||||
ControllerOutput(SDL_GAMEPAD_BUTTON_NORTH), // Triangle
|
||||
@@ -534,6 +535,9 @@ void ControllerOutput::FinalizeUpdate() {
|
||||
// to do it, and it would be inconvenient to force it here, when AddUpdate does the job just
|
||||
// fine, and a toggle doesn't have to checked against every input that's bound to it, it's
|
||||
// enough that one is pressed
|
||||
case MOUSE_GYRO_ROLL_MODE:
|
||||
SetMouseGyroRollMode(new_button_state);
|
||||
break;
|
||||
default: // is a normal key (hopefully)
|
||||
controller->CheckButton(0, SDLGamepadToOrbisButton(button), new_button_state);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user