G515: first wake key after LED sleep is dropped (Shift at password prompt)
Information
- Solaar version: 1.1.20
- Distribution: Fedora Linux 44 (KDE Plasma Desktop Edition)
- Kernel version: Linux 7.1.8-200.fc44.x86_64 x86_64 GNU/Linux
- Output of
solaar show(G515 / Lightspeed receiver):
solaar version 1.1.20
Lightspeed Receiver
Device path : /dev/hidraw3
USB id : 046d:C547
Serial : 0116F63F
Has 2 paired device(s) out of a maximum of 2.
1: G515 LS TKL
Device path : /dev/hidraw5
WPID : 40B4
Codename : G515 LS TKL
Kind : keyboard
Protocol : HID++ 4.2
Report Rate : 8ms
Serial number: 498C9308
Model ID: B38940B4C355
Unit ID: 498C9308
1: BL2 19.00.B0010
0: MPK 25.00.B0010
Supports 34 HID++ 2.0 features:
9: RGB EFFECTS {8071} V4
LED Control (saved): True
LED Control : True
Idle Effect (saved): !LEDEffectSetting {ID: 128, intensity: 50}
Idle Timeout (saved): 1 Minute
Sleep Timeout (saved): 5 Minutes
10: PER KEY LIGHTING V2 {8081} V0- Relevant
~/.config/solaar/config.yaml(G515 entry):
- _NAME: G515 LS TKL
_modelId: B38940B4C355
_wpid: 40B4
rgb_control: true
rgb_idle_effect: !LEDEffectSetting {ID: 128, intensity: 50}
rgb_idle_timeout: 60
rgb_sleep_timeout: 300
rgb_zone_1: !LEDEffectSetting {ID: 1, color: 0xffffff, intensity: 100, period: 5000}Describe the bug
When the G515 Lightspeed TKL has gone to sleep (LEDs off after the 5-minute software sleep timeout), if the first wake key is Shift, the keyboard wakes but the system never sees Shift held. The next character is unshifted. Easy to hit at a lock-screen / password prompt whose first letter is capital.
The keyboard itself does wake; only the wake key is missing from HID input. A letter as the wake key just eats one character; Shift is worse because it is typically held into the next key.
This started after the 1.1.20 G515 LED rewrite (#2791 / #3149). rgb_control is Solaar, idle 60s, sleep 300s.
To Reproduce
- Leave the G515 idle until the LEDs go fully off (default sleep timeout 5 minutes).
- Press and hold Left Shift, then type a letter.
- The letter arrives unshifted. Subsequent Shift+letter while the keyboard is awake works normally.
Additional context
Software sleep sent SetRgbPowerMode(3) (0x8071 function 8). On this keyboard that parks the HID key-scan. The wake key produces an onUserActivity notification; Solaar immediately replied with SetRgbPowerMode(1) plus color restore on the same radio as the HID report, so the first key is consumed as a wake event and not reported.
Fix in #3309: blank LEDs in software instead of SetRgbPowerMode(3), disable the firmware sleep timer, skip SetRgbPowerMode on wake, and defer HID++ restore so it does not race the wake-key HID report. Confirmed on this G515 after copying the patched rgb_power.py over 1.1.20.
Related to, but not the same as, #2791 (LED persistence / demo mode).
Source: pwr-Solaar/Solaar