0
0
Fork 0

Revert "sdl: set SDL_HINT_GAMECONTROLLER_USE_BUTTON_LABELS to 0 (#5433)" (#5439)

This reverts commit 2b5abac809.
This commit is contained in:
Mary 2023-07-06 18:08:14 +02:00 committed by GitHub
parent 2b5abac809
commit 8a363b5df2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 18 additions and 13 deletions

View file

@ -597,6 +597,8 @@ namespace Ryujinx.Ava.UI.ViewModels
} }
else if (activeDevice.Type == DeviceType.Controller) else if (activeDevice.Type == DeviceType.Controller)
{ {
bool isNintendoStyle = Devices.ToList().Find(x => x.Id == activeDevice.Id).Name.Contains("Nintendo");
string id = activeDevice.Id.Split(" ")[0]; string id = activeDevice.Id.Split(" ")[0];
config = new StandardControllerInputConfig config = new StandardControllerInputConfig
@ -631,10 +633,10 @@ namespace Ryujinx.Ava.UI.ViewModels
}, },
RightJoycon = new RightJoyconCommonConfig<ConfigGamepadInputId> RightJoycon = new RightJoyconCommonConfig<ConfigGamepadInputId>
{ {
ButtonA = ConfigGamepadInputId.B, ButtonA = isNintendoStyle ? ConfigGamepadInputId.A : ConfigGamepadInputId.B,
ButtonB = ConfigGamepadInputId.A, ButtonB = isNintendoStyle ? ConfigGamepadInputId.B : ConfigGamepadInputId.A,
ButtonX = ConfigGamepadInputId.Y, ButtonX = isNintendoStyle ? ConfigGamepadInputId.X : ConfigGamepadInputId.Y,
ButtonY = ConfigGamepadInputId.X, ButtonY = isNintendoStyle ? ConfigGamepadInputId.Y : ConfigGamepadInputId.X,
ButtonPlus = ConfigGamepadInputId.Plus, ButtonPlus = ConfigGamepadInputId.Plus,
ButtonR = ConfigGamepadInputId.RightShoulder, ButtonR = ConfigGamepadInputId.RightShoulder,
ButtonZr = ConfigGamepadInputId.RightTrigger, ButtonZr = ConfigGamepadInputId.RightTrigger,

View file

@ -195,6 +195,8 @@ namespace Ryujinx.Headless.SDL2
} }
else else
{ {
bool isNintendoStyle = gamepadName.Contains("Nintendo");
config = new StandardControllerInputConfig config = new StandardControllerInputConfig
{ {
Version = InputConfig.CurrentVersion, Version = InputConfig.CurrentVersion,
@ -230,10 +232,10 @@ namespace Ryujinx.Headless.SDL2
RightJoycon = new RightJoyconCommonConfig<ConfigGamepadInputId> RightJoycon = new RightJoyconCommonConfig<ConfigGamepadInputId>
{ {
ButtonA = ConfigGamepadInputId.B, ButtonA = isNintendoStyle ? ConfigGamepadInputId.A : ConfigGamepadInputId.B,
ButtonB = ConfigGamepadInputId.A, ButtonB = isNintendoStyle ? ConfigGamepadInputId.B : ConfigGamepadInputId.A,
ButtonX = ConfigGamepadInputId.Y, ButtonX = isNintendoStyle ? ConfigGamepadInputId.X : ConfigGamepadInputId.Y,
ButtonY = ConfigGamepadInputId.X, ButtonY = isNintendoStyle ? ConfigGamepadInputId.Y : ConfigGamepadInputId.X,
ButtonPlus = ConfigGamepadInputId.Plus, ButtonPlus = ConfigGamepadInputId.Plus,
ButtonR = ConfigGamepadInputId.RightShoulder, ButtonR = ConfigGamepadInputId.RightShoulder,
ButtonZr = ConfigGamepadInputId.RightTrigger, ButtonZr = ConfigGamepadInputId.RightTrigger,

View file

@ -60,7 +60,6 @@ namespace Ryujinx.SDL2.Common
SDL_SetHint(SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS, "1"); SDL_SetHint(SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS, "1");
SDL_SetHint(SDL_HINT_JOYSTICK_HIDAPI_SWITCH_HOME_LED, "0"); SDL_SetHint(SDL_HINT_JOYSTICK_HIDAPI_SWITCH_HOME_LED, "0");
SDL_SetHint(SDL_HINT_JOYSTICK_HIDAPI_JOY_CONS, "1"); SDL_SetHint(SDL_HINT_JOYSTICK_HIDAPI_JOY_CONS, "1");
SDL_SetHint(SDL_HINT_GAMECONTROLLER_USE_BUTTON_LABELS, "0");
SDL_SetHint(SDL_HINT_VIDEO_ALLOW_SCREENSAVER, "1"); SDL_SetHint(SDL_HINT_VIDEO_ALLOW_SCREENSAVER, "1");

View file

@ -1035,6 +1035,8 @@ namespace Ryujinx.Ui.Windows
} }
else if (_inputDevice.ActiveId.StartsWith("controller")) else if (_inputDevice.ActiveId.StartsWith("controller"))
{ {
bool isNintendoStyle = _inputDevice.ActiveText.Contains("Nintendo");
config = new StandardControllerInputConfig config = new StandardControllerInputConfig
{ {
Version = InputConfig.CurrentVersion, Version = InputConfig.CurrentVersion,
@ -1070,10 +1072,10 @@ namespace Ryujinx.Ui.Windows
RightJoycon = new RightJoyconCommonConfig<ConfigGamepadInputId> RightJoycon = new RightJoyconCommonConfig<ConfigGamepadInputId>
{ {
ButtonA = ConfigGamepadInputId.B, ButtonA = isNintendoStyle ? ConfigGamepadInputId.A : ConfigGamepadInputId.B,
ButtonB = ConfigGamepadInputId.A, ButtonB = isNintendoStyle ? ConfigGamepadInputId.B : ConfigGamepadInputId.A,
ButtonX = ConfigGamepadInputId.Y, ButtonX = isNintendoStyle ? ConfigGamepadInputId.X : ConfigGamepadInputId.Y,
ButtonY = ConfigGamepadInputId.X, ButtonY = isNintendoStyle ? ConfigGamepadInputId.Y : ConfigGamepadInputId.X,
ButtonPlus = ConfigGamepadInputId.Plus, ButtonPlus = ConfigGamepadInputId.Plus,
ButtonR = ConfigGamepadInputId.RightShoulder, ButtonR = ConfigGamepadInputId.RightShoulder,
ButtonZr = ConfigGamepadInputId.RightTrigger, ButtonZr = ConfigGamepadInputId.RightTrigger,