Skip to content
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

[Feature Request] Deadzone radius setting for touch analog stick #15022

Open
Leopard20 opened this issue Oct 17, 2021 · 5 comments · May be fixed by #15030
Open

[Feature Request] Deadzone radius setting for touch analog stick #15022

Leopard20 opened this issue Oct 17, 2021 · 5 comments · May be fixed by #15030
Labels
Input/Controller Input and controller issues
Milestone

Comments

@Leopard20
Copy link
Contributor

Leopard20 commented Oct 17, 2021

Currently it's not possible to change the touch analog stick deadzone radius. It is extremely important though. Right now the "central circle" has to be moved to the corner of the outer circle before any input is registered.

I think the "Calibrate analog stick" settings should be applied to the touch ones as well.

@Leopard20 Leopard20 changed the title [Feature Request] Touch analog customization [Feature Request] Deadzone radius setting for touch analog stick Oct 17, 2021
@iota97
Copy link
Contributor

iota97 commented Oct 17, 2021

Just few random thought about this:

Applying the setting will change the default (not by much tho'). We could also have the same setting only for touch but kinda meh.

Applying the setting is really easy, what's trickier imho is how to handle the touch stick draw.

Currently the stick position peak the PSP data struct, this can't work if we remap the value (it will have to match the pressed position on the screen rather than the value send to the PSP logic, like custom stick)

If you move the stick with other mean should it should peek psp data i.e:

// Draw logic
if (dragPointerID_ == -1) 
  //use_psp_control_struct
else
  //use_touch_pos

Then we should probably inverse remap the PSP data to match the visual, this get a bit trickier as PeekAnalogPos should probably return 0.0f when nothing is moved (it uses 127.5f and the data is a int that get rounded to 127, I'm not sure if that have a reason or a edge case bug).

@Leopard20
Copy link
Contributor Author

Leopard20 commented Oct 17, 2021

@iota97
Yeah good point, but I don't think it matters that much. If you use another input method why would it matter how you see it on the touch control? You don't read screen coords as long as you don't touch the screen so there shouldn't be a problem. 🤔

@unknownbrackets
Copy link
Collaborator

unknownbrackets commented Oct 17, 2021

Well, the range is [0, 255] and it's being mapped to [-1, 1]. 128 is central value, because it rounds up, but if we subtracted and divided by 128 it would become impossible to get 1.

That said, we could quantize it to 0, since we really want ..., -0.0196, -0.0117, 0, 0.0117, 0.0196. If we rounded to the nearest 0.01 it'd be fine, I suppose.

Right now the "central circle" has to be moved to the corner of the outer circle before any input is registered.

So if I understand right, the concern here is that the PSP game code is applying a deadzone that requires you go all the way to the edge, and we want to apply the inverse deadzone so you don't have to move it as far. Right? Seems like we might just apply the inverse of the inverse deadzone to the scale in drawing it maybe...

-[Unknown]

@Leopard20
Copy link
Contributor Author

So if I understand right, the concern here is that the PSP game code is applying a deadzone that requires you go all the way to the edge, and we want to apply the inverse deadzone so you don't have to move it as far. Right?

Yeah, but not necessarily a game. Even when I use the right analog stick with a custom binding (bound to action keys) the problem still persists (input is only registered when the "stick" crosses the circle, and no input is registered inside the circle)

@unknownbrackets
Copy link
Collaborator

Well, I think the right analog's thresholds are hardcoded at 50%. But afaik the left touch analog stick has no natural deadzone, so only the game is applying one there.

-[Unknown]

@hrydgard hrydgard added the Input/Controller Input and controller issues label Oct 18, 2021
@hrydgard hrydgard added this to the Future milestone Oct 18, 2021
@iota97 iota97 linked a pull request Oct 18, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Input/Controller Input and controller issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants