-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Do axis keymap as well (should replace right stick bind) #2692
Conversation
Not sure where to fit it...
This way people don't say "but my X button shows up as L1."
As it was before.
I think it should work with XInput now too. -[Unknown] |
The accelerometer (allowing any direction) is probably pretty doable too, but would need to be normalized and have gravity removed from the equation. -[Unknown] |
@@ -344,14 +425,9 @@ void EmuScreen::update(InputState &input) { | |||
if (g_Config.bAccelerometerToAnalogHoriz) { | |||
// TODO: Deadzone, etc. | |||
leftstick_x += clamp1(curve1(input.acc.y) * 2.0f); | |||
leftstick_x = clamp1(leftstick_x); | |||
__CtrlSetAnalogX(clamp1(leftstick_x), CTRL_STICK_LEFT); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will override the horizontal axis with the tilt, right, if the option is enabled? Previously, they got added together. Dunno if this is reasonably possible with the mapping system though, and as you say, the accelerometer should simply be two or three additional axes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does add still (leftstick_x += clamp1(curve1(...
), since the variable lives the whole time. It will mean it'll jump from the crosspad to the tilt in the worst case. I can improve this but I was figuring it would go away soon anyway.
-[Unknown]
Hm, maybe should add UI to map the right stick too, otherwise this is a (very small) regression. Could also do that later. I might merge without it :) Anyway, great stuff! Seems pretty complete. |
I'm still not sure the right stick was even working before, since it was always writing 0x80 to the position afaict. But where do I fit it in the UI? It's already got a lot going on. -[Unknown] |
@unknownbrackets : The right stick was working on DirectInput when I checked out your commits a few hours ago. It really needs a GUI option though, so it doesn't overwrite other controls.. |
To clarify: right stick works great for mapping the right stick to buttons or arrows. However, it is currently not possible to map anything TO the PSP right stick (which of course does not exist, except in the PS3 and possibly Vita emulator, and a very short list of games support it AFAIU.) I don't have any games to test this with, though. But, the mapping is possible it's just there's no slot in the UI to actually select to map something TO the PSP right stick. -[Unknown] |
Oh yeah of course, you're right that it can be used as a mapping source as it is. I'm silly. |
Do axis keymap as well (should replace right stick bind)
Yeah, from a source perspective, this only improves things - for DirectInput, you can now select any of several axes (could add more but I wasn't even sure what some of them were), and also can map more buttons than before for crazy buttony controllers (up to 16.) For XInput, it doesn't map the triggers as analogs but I figured that wasn't really necessary... -[Unknown] |
Only tested with onscreen controls and DirectInput currently. Made sure keyboard was still usable even with controller mapped to buttons.
It took me a sad amount of time to realize I needed 5f382c5.
Anyway, it should work well, and also allows people to reverse the analog direction. There's still todos:
Fixes #2503.
-[Unknown]