-
Notifications
You must be signed in to change notification settings - Fork 100
Japanese Layout in Menus (Swaps Accept/Confirm button) #625
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: port
Are you sure you want to change the base?
Japanese Layout in Menus (Swaps Accept/Confirm button) #625
Conversation
`SDL_HINT_GAMECONTROLLER_USE_BUTTON_LABELS` will follow the Button Labels, which causes issues in games that uses it. This commit will turn it off by default, but the default can be restored via `useNintendoLayout` within pd.ini file
…yout `SDL_HINT_GAMECONTROLLER_USE_BUTTON_LABELS` is set to 0, which will follow the positional diamond-shaped face buttons on the game controller. making everything more streamlined and easier to translate across all modern contorllers. This solves a specific issue with Japanese-style face buttons for `BUTTON_UI_ACCEPT`/`BUTTON_UI_CANCEL` actions has been added. A bit of a hacky workaround, but it'll do for now. By default: it'll only kicks in when using a Nintendo Switch controller, but `JapaneseButtonLayout` is accessible within `pd.ini`
leftovers due to switching to Visual Studios code
when going to the Keybind page, you'd see "[JPN LAYOUT - B/A]" on UI Accept/Cancel text, UI Text will change dynamically.
|
Note: this PR also contains issues with build-i686-linux. It won't compile properly due to "SDL_CONTROLLER_TYPE" interacts with Nintendo Switch controller types, but based on initial look: I believe this is related to using older version of SDL for i686-linux As this PR is more or less a foundation for adding proper Button Labels support while viewing the keybind menu, this PR can't be pushed until that'd be solved. |
|
I don't use gamepads when I can help it for FPSes, but as someone who prefers to use Circle as confirm and Cross as cancel on their DualSense, I approve of having an convenient option to swap confirm/cancel without altering in-gameplay controls. I do wish to ask one question though: If the option to swap ABXY to BAYX and the option to just swap confirm and cancel are both separate and potentially can be both enabled at the same time, what happens if you do just that? Do you end up with a weird layout where the bottom button is confirm and the right is cancel, but the left and top buttons have their functions swapped? Or does one of them override the other? |
Setting that hint (called "useNintendoLayout") defaults back to original default hint, and |
|
The A/B/X/Y swapping is a good feature, however I feel like the "Japanese layout" thing can be just as well accomplished by just swapping the bindings on the Accept/Cancel buttons in the Extended Controls menu. I don't really want to add to the already complicated and confusing input logic just to make it very slightly easier to do, as it's already a pretty niche thing. The i686 problem is likely because the version of SDL2 available (or just used) for i686-linux is older and does not have this feature. It is in general best to guard these things with I won't add controller-specific deadzone settings, that's a bit too insane. It also depends on the specific Switch controller. I tested these settings against the joycons on my own early model Switch and it was fine. It's generally not possible to account for everything, which is why the deadzone is user-adjustable. |
Not a new feature, a necessity. After playing with my Nintendo Switch controller, it follows the Nintendo layout in a literal way. I could rebind them to correct it, but since I often switch (no pun intended) controller types: it retroactively changes Player 1/2/3/4 bindings in the process. This is not ideal. This is why I originally planned for the hardcoded approach, but based on feedback: I might revise it by opting for Button Input instead of an action. note: this setup happened to be a standard in Nintendo Switch games, even in Nintendo's own games: Face Button swap only applies to Menus while Gameplay remains the same. SDL maintainers also suggested doing so.
Which is why I'm deciding whenever or not:
|
…apanese layout also changed the guard function for GitHubAction CI
reverted back to the game action-based setup for the time being. this might be revised when a separate PR changes the Button Input labels. (make it easier to troubleshoot
to better accout for uncalibrated joysticks: the default joystick slider will be increasing to 6 percent. This should address a specific issue for first-party Nintendo Switch Pro Controller users who can't calibrate their joystick drifts.
this will be moved to a separate PR (fgsfdsfgs#627).
got good news to tell @fgsfdsfgs: the next SDL2/3 release candidate (or Steam Beta client as of this writing) will address this issue. I tested it using the main branch of SDL2 to confirm this specific problem is solved. We can wait for the next release before making this PR ready for review. |
libsdl-org/SDL#13260 addresses this particular issue for Nintendo Switch Pro Controller's center deadzone, this: the original default deadzone has been restored to 4 percent and 6 percent
Cleaned up and fixed the remaining bugs within the input system. Options Menu's Bind UI should now correctly reflect the Japanese Layout
temporarily removed Get and Set functions, as it's leftover code for a pending Menu UI toggle..
To better prepare for `SDL_GetGamepadButtonLabel`/SDL3: the entire setup has been simplified by combining `inputIsJapaneseLayoutActive` and `inputRemapUIButton` into one, while giving it a new name
ok, after experimented with Example code: This gets rid of the need for Nintendo Switch-specific detection system as |
double-checked SDL2 version to addrsss incorrect build release`
to make things a bit more consistent, the order on how to enable or disable has been swapped
this time: actually follow the order
this reduces the sheer amount of bloat, as most of the functions are moved to a helper function. This also fixes a bug where the Swap applies to all Actions while rebinding.
note: this PR requires #627
What
SDL_HINT_GAMECONTROLLER_USE_BUTTON_LABELSdoes is that SDL's Controller API will follow on Button Labels, by default: it is set to1. Consequences: the modern Nintendo Switch layout will be using the Nintendo Layout across Menu Navigation and Gameplay.Beyond copy-pasting: it results in muscle memory. The initial workaround would be to rebind to the Key Binding section, but I argue it ain't very nice. Taking a page from yquake2/yquake2@9e07dc2, I took a stab at it myself. the results is very mixed and feels a bit hacky-- but it should be easier on the UI/UX front.
do note that it only applies to both "ACCEPT_BUTTON/CK_ACCEPT" and "CANCEL_BUTTON/CK_CANCEL" action at the moment, no plans to touch
Use / Accept/CancelactionWhile both toggles aren't accessible in-game, both
JapaneseButtonLayout(will only swap Menu Accept/Cancel) is always accessible withinpd.ini.As of this writing: the only holdout is the deadzone itself. Right now: bothDEFAULT_DEADZONE(4096) andDEFAULT_DEADZONE_RY(6144) controls baseline deadzone slider, but if using a legitament Nintendo Switch controller (not the third-party kind): both left and right stick will drift. That part might be easily addressable by increasing both sliders, or add a NintendoSwitch-specific deadzone slider to remedy the problem.