revert input system to main

This commit is contained in:
lizzie 2026-01-24 18:34:49 +00:00
parent 4ab97b771f
commit 3a16227efc
17 changed files with 47 additions and 112 deletions

View file

@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
// SPDX-FileCopyrightText: 2018 Citra Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
@ -92,7 +92,6 @@ public:
}
void EnableMotion() {
#if SDL_VERSION_ATLEAST(2, 26, 4)
if (!sdl_controller) {
return;
}
@ -175,7 +174,6 @@ public:
motion.delta_timestamp = time_difference;
return true;
}
#endif
const BasicMotion& GetMotion() const {
return motion;
@ -354,7 +352,6 @@ public:
}
std::string GetControllerName() const {
#if SDL_VERSION_ATLEAST(2, 26, 4)
if (sdl_controller) {
switch (SDL_GetGamepadType(sdl_controller.get())) {
case SDL_GAMEPAD_TYPE_XBOX360:
@ -368,8 +365,6 @@ public:
case SDL_GAMEPAD_TYPE_PS5:
return "DualSense Controller";
default:
if (auto const name = SDL_GameControllerName(sdl_controller.get()); name)
return name;
break;
}
const auto name = SDL_GetGamepadName(sdl_controller.get());
@ -377,7 +372,6 @@ public:
return name;
}
}
#endif
if (sdl_joystick) {
const auto name = SDL_GetJoystickName(sdl_joystick.get());
@ -645,7 +639,6 @@ void SDLDriver::CloseJoysticks() {
}
SDLDriver::SDLDriver(std::string input_engine_) : InputEngine(std::move(input_engine_)) {
#if SDL_VERSION_ATLEAST(2, 26, 4)
// Set our application name. Currently passed to DBus by SDL and visible to the user through
// their desktop environment.
SDL_SetHint(SDL_HINT_APP_NAME, "Eden");
@ -684,7 +677,6 @@ SDLDriver::SDLDriver(std::string input_engine_) : InputEngine(std::move(input_en
// Disable hidapi driver for xbox. Already default on Windows, this causes conflict with native
// driver on Linux.
SDL_SetHint(SDL_HINT_JOYSTICK_HIDAPI_XBOX, "0");
#endif
// If the frontend is going to manage the event loop, then we don't start one here
start_thread = SDL_WasInit(SDL_INIT_JOYSTICK | SDL_INIT_GAMEPAD) == 0;
@ -994,7 +986,6 @@ ButtonBindings SDLDriver::GetDefaultButtonBinding(
auto slr_button = SDL_GAMEPAD_BUTTON_LEFT_SHOULDER;
auto srr_button = SDL_GAMEPAD_BUTTON_RIGHT_SHOULDER;
#if SDL_VERSION_ATLEAST(2, 26, 4)
if (joystick->IsJoyconLeft()) {
sll_button = SDL_GAMEPAD_BUTTON_LEFT_PADDLE1;
srl_button = SDL_GAMEPAD_BUTTON_LEFT_PADDLE2;
@ -1003,7 +994,6 @@ ButtonBindings SDLDriver::GetDefaultButtonBinding(
slr_button = SDL_GAMEPAD_BUTTON_RIGHT_PADDLE2;
srr_button = SDL_GAMEPAD_BUTTON_RIGHT_PADDLE1;
}
#endif
return {
std::pair{Settings::NativeButton::A, SDL_GAMEPAD_BUTTON_EAST},