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

input: update keyboard led state #127

Merged
merged 1 commit into from
Jan 28, 2024

Conversation

cmeissl
Copy link
Contributor

@cmeissl cmeissl commented Jan 26, 2024

track and update the keyboard led states

depends on Smithay/smithay#1298

fixes #128

@cmeissl cmeissl force-pushed the feature/keyboard_led_state branch 2 times, most recently from 63edd14 to 314e70f Compare January 27, 2024 11:21
@cmeissl cmeissl force-pushed the feature/keyboard_led_state branch 2 times, most recently from f92b3fd to 3900dbf Compare January 27, 2024 19:48
@cmeissl cmeissl marked this pull request as ready for review January 27, 2024 19:51
@cmeissl cmeissl mentioned this pull request Jan 28, 2024
@YaLTeR
Copy link
Owner

YaLTeR commented Jan 28, 2024

After I turn on Num Lock and switch TTY back and forth, the LED remains off until the first keyboard event.

@cmeissl
Copy link
Contributor Author

cmeissl commented Jan 28, 2024

After I turn on Num Lock and switch TTY back and forth, the LED remains off until the first keyboard event.

Strange, this works for me just fine and I don't see anything obvious why it shouldn't work. On suspending the libinput session all devices are removed. Upon resume all devices are (re-)added which updates the led state.
I wonder what is different in your setup.

@YaLTeR
Copy link
Owner

YaLTeR commented Jan 28, 2024

Not sure. I also just noticed that even if the LED is on on the vconsole TTY that I'm switching back and forth with, upon coming back the LED turns off, until some libinput event I guess, moving the mouse or touchpad also updates it back on.

@cmeissl
Copy link
Contributor Author

cmeissl commented Jan 28, 2024

I think it is normal that it will turn off, the device has been removed and is re-added. But it should turn back on right away again because the code updates the leds on device re-add. Hard to say why this does not happen. sway and weston will remove the whole keyboard, so it will loose the state.

Which version of libinput do you have installed?
Can you also post your xkb config so I can try with these settings?

@YaLTeR
Copy link
Owner

YaLTeR commented Jan 28, 2024

libinput-1.25.0-1.fc39.x86_64, happens with the default config too

This is kinda weird, I ran another niri instance on a TTY where I had Num Lock on on the vconsole, and there the LED was turning on on a TTY switch until another libinput event. Then after exiting that niri instance, the LED was off in the vconsole, until I disabled and enabled Num Lock.

@cmeissl
Copy link
Contributor Author

cmeissl commented Jan 28, 2024

Okay, I somehow managed to reproduce this, but only when going through gdm after a tty switch.
I added some debug prints and in this case the whole input session seems to be delayed until some input triggers it like moving the mouse.

@cmeissl
Copy link
Contributor Author

cmeissl commented Jan 28, 2024

So, I think this is either caused by libinput itself or by the libinput backend in smithay.
I will try to find the root cause, but I don't think this is caused by an issue in this PR or the PR that added support for the led stuff in smithay.

As it seems that both, weston and wlroots, completely remove the keyboard (resetting its state) the num lock is just off there anyway and it might be caused by libinput itself delaying stuff.

@YaLTeR
Copy link
Owner

YaLTeR commented Jan 28, 2024

I see, interesting. Well it's the only problem I stumbled into so far and it's not really a major one I guess

@cmeissl
Copy link
Contributor Author

cmeissl commented Jan 28, 2024

Can reproduce on sway with auto enabled NUMLOCK, led stays off until first physical interaction, so I would say this is a issue in libinput

sway config:

input * {
    xkb_layout "at(nodeadkeys)"
    xkb_numlock enabled
}

@YaLTeR
Copy link
Owner

YaLTeR commented Jan 28, 2024

Yeah, reproduces in sway for me too.

@YaLTeR YaLTeR merged commit 597ea62 into YaLTeR:main Jan 28, 2024
5 checks passed
@YaLTeR
Copy link
Owner

YaLTeR commented Jan 28, 2024

Thanks

@cmeissl cmeissl deleted the feature/keyboard_led_state branch January 28, 2024 19:49
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.

Keyboard LEDs don't light up
2 participants