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

ControllerInterface: Exposse DSU client battery level as an input. #8474

Open
wants to merge 2 commits into
base: master
from

Conversation

@jordan-woyak
Copy link
Member

jordan-woyak commented Nov 17, 2019

Tested with an Android DSU Server.

I've named the input "Battery". It should be visible in the "Advanced" mapping dialog.
If someone prefers "Battery Level" or something else I don't have a strong opinion.

This is mainly intended to be used with PR #8417 to pass-through the battery level to an emulated Wii remote.

@jordan-woyak jordan-woyak force-pushed the jordan-woyak:dsu-battery branch from 053c559 to 9d50940 Nov 17, 2019
@jordan-woyak jordan-woyak force-pushed the jordan-woyak:dsu-battery branch from 9d50940 to 6d82dd2 Nov 17, 2019
@AdmiralCurtiss

This comment has been minimized.

Copy link
Contributor

AdmiralCurtiss commented Nov 17, 2019

Would it make more sense to define 1.0 as maximum battery on the emulated Wii remote side so we don't have to special case the input here?

@jordan-woyak

This comment has been minimized.

Copy link
Member Author

jordan-woyak commented Nov 17, 2019

Would it make more sense to define 1.0 as maximum battery on the emulated Wii remote side so we don't have to special case the input here?

I've mentioned in the comment above the constexpr defintion why I think 100 is a better decision.
No one is ever going to normally map this "Input" to a button press and if they actually do they can be smart enough to divide by 100.
People are going to map this to the "Battery" setting 99% of the time which will expect 100 as the maximum value. Requiring they multiply by 100 will be annoying and confusing to users.

@AdmiralCurtiss

This comment has been minimized.

Copy link
Contributor

AdmiralCurtiss commented Nov 17, 2019

No, what I mean is, why have the 'Battery' setting expect 100 as the maximum value instead of 1.

@jordan-woyak

This comment has been minimized.

Copy link
Member Author

jordan-woyak commented Nov 17, 2019

No, what I mean is, why have the 'Battery' setting expect 100 as the maximum value instead of 1.

Oh.. :P

Well.. the setting already exists as a percentage. I think that's a more friendly interface for people not doing battery "pass through". It would require breaking configs or even more special-case handling to change it now. I think this is the lesser evil. I don't think it's too horrible to have a very specific kind of input take on a different maximum value. Accelerometer and gyroscope inputs return m/s/s and rad/s, similarly.

@AdmiralCurtiss

This comment has been minimized.

Copy link
Contributor

AdmiralCurtiss commented Nov 17, 2019

Ah, fair enough, I didn't realize that Battery setting already existed. In that case yeah this is probably fine.

@rlnilsen

This comment has been minimized.

Copy link
Contributor

rlnilsen commented Nov 17, 2019

@jordan-woyak I'm glad you did this, as my brain is mush right now (and I don't know how long it will last). I've looked over the changes and there's nothing jumping out at me, although that might not be anything to go by.

@mbc07

This comment has been minimized.

Copy link
Contributor

mbc07 commented Nov 17, 2019

Tested with both DS4 and Wiimote DSU Servers and works as expected. Sweet!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
5 participants
You can’t perform that action at this time.