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

Set Combined Joycons' player LED status #49

Merged

Conversation

joaorb64
Copy link
Contributor

@joaorb64 joaorb64 commented Jan 7, 2021

Possible solution to both #48 and joaorb64/joycond-cemuhook#27

evdev has set LED codes, so the virtual device mappings end up showing up as LED_NUML, LED_CAPSL, LED_SCROLLL, and LED_COMPOSE, but their codes are 0, 1, 2, and 3.

evtest displays:

Event type 17 (EV_LED)
    Event code 0 (LED_NUML) state 1
    Event code 1 (LED_CAPSL) state 0
    Event code 2 (LED_SCROLLL) state 0
    Event code 3 (LED_COMPOSE) state 0

while /sys/class/input/inputX has:

inputX::numlock/brightness
inputX::capslock/brightness
inputX::scrolllock/brightness
inputX::compose/brightness

I'm not sure if this is the best possible way to do this or if this is too much of a stretch, but this is what I could come up with.

@joaorb64
Copy link
Contributor Author

joaorb64 commented Jan 7, 2021

I tried running joycond-cemuhook as sudo to play with the Home LED and had another idea, actually. The individual joycons are accessible for sudo all the time and they have correct LED status. I could actually go by this route without these changes to joycond.

Edit: joaorb64/joycond-cemuhook#27 (comment)

src/ctlr_mgr.cpp Outdated Show resolved Hide resolved
src/virt_ctlr_combined.cpp Outdated Show resolved Hide resolved
src/virt_ctlr_combined.cpp Show resolved Hide resolved
src/virt_ctlr_combined.cpp Outdated Show resolved Hide resolved
@DanielOgorchock
Copy link
Owner

Looks cool, thanks! The only thing I can see as potentially problematic is if someone/something else decides to set the player LEDs. Shouldn't happen in practice for people just using the typical hid-nintendo->joycond->joycond-cemuhook stack. If they ever add uniq support to uinput, I guess we can change to using that for more robustness.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants