pwr-Solaar / Solaar

Linux device manager for Logitech devices
https://pwr-solaar.github.io/Solaar
GNU General Public License v2.0
5.54k stars 410 forks source link

Brightness Up and Down keys not working #2510

Closed abeidahmed closed 5 months ago

abeidahmed commented 5 months ago

Information

``` MX Keys Mini Device path : /dev/hidraw2 USB id : 046d:B369 Codename : MX Keys Mini Kind : keyboard Protocol : HID++ 4.5 Serial number: Model ID: B36900000000 Unit ID: 84917D97 1: BL1 53.02.B0007 0: RBK 73.02.B0007 3: Supports 32 HID++ 2.0 features: 0: ROOT {0000} V0 1: FEATURE SET {0001} V0 2: DEVICE FW VERSION {0003} V4 Firmware: Bootloader BL1 53.02.B0007 B3696B3A7A98 Firmware: Firmware RBK 73.02.B0007 B3696B3A7A98 Firmware: Other Unit ID: 84917D97 Model ID: B36900000000 Transport IDs: {'btleid': 'B369'} 3: DEVICE NAME {0005} V0 Name: MX Keys Mini Kind: keyboard 4: WIRELESS DEVICE STATUS {1D4B} V0 5: CONFIG CHANGE {0020} V0 Configuration: 11000000000000000000000000000000 6: DEVICE FRIENDLY NAME {0007} V0 Friendly Name: MX Keys Mini 7: UNIFIED BATTERY {1004} V2 Battery: 100%, 0. 8: REPROG CONTROLS V4 {1B04} V5 Key/Button Diversion (saved): {Backlight Down:Regular, Backlight Up:Regular, Play/Pause Fn:Regular, Mute Fn:Regular, Volume Down Fn:Regular, Volume Up Fn:Regular, Voice Dictation:Regular, Open Emoji Panel:Diverted, Snipping Tool:Regular, Delete:Regular, Mute Microphone:Regular} Key/Button Diversion : {Backlight Down:Regular, Backlight Up:Regular, Play/Pause Fn:Regular, Mute Fn:Regular, Volume Down Fn:Regular, Volume Up Fn:Regular, Voice Dictation:Regular, Open Emoji Panel:Diverted, Snipping Tool:Regular, Delete:Regular, Mute Microphone:Regular} 9: CHANGE HOST {1814} V1 Change Host : 1:pop-os 10: HOSTS INFO {1815} V1 Host 0 (paired): pop-os Host 1 (unpaired): Host 2 (unpaired): 11: BACKLIGHT2 {1982} V1 Backlight (saved): Disabled Backlight : Disabled 12: K375S FN INVERSION {40A3} V0 Swap Fx function (saved): True Swap Fx function : True 13: LOCK KEY STATE {4220} V0 14: KEYBOARD DISABLE KEYS {4521} V0 Disable keys (saved): {Caps Lock:False, Insert:False, Win:False} Disable keys : {Caps Lock:False, Insert:False, Win:False} 15: MULTIPLATFORM {4531} V1 Set OS (saved): Android Set OS : Android 16: DFUCONTROL {00C3} V0 17: DEVICE RESET {1802} V0 internal, hidden, unknown:000010 18: unknown:1803 {1803} V0 internal, hidden, unknown:000010 19: CONFIG DEVICE PROPS {1806} V8 internal, hidden, unknown:000010 20: unknown:1816 {1816} V0 internal, hidden, unknown:000010 21: OOBSTATE {1805} V0 internal, hidden 22: unknown:1830 {1830} V0 internal, hidden, unknown:000010 23: unknown:1891 {1891} V6 internal, hidden, unknown:000008 24: unknown:18A1 {18A1} V0 internal, hidden, unknown:000010 25: unknown:1E00 {1E00} V0 hidden 26: unknown:1E02 {1E02} V0 internal, hidden 27: unknown:1602 {1602} V0 28: unknown:1EB0 {1EB0} V0 internal, hidden, unknown:000010 29: unknown:1861 {1861} V0 internal, hidden, unknown:000010 30: unknown:1A20 {1A20} V0 internal, hidden, unknown:000010 31: unknown:18B0 {18B0} V0 internal, hidden, unknown:000010 Has 16 reprogrammable keys: 0: Host Switch Channel 1 , default: HostSwitch Channel 1 => HostSwitch Channel 1 is FN, FN sensitive, analytics key events, pos:1, group:0, group mask:empty reporting: default 1: Host Switch Channel 2 , default: HostSwitch Channel 2 => HostSwitch Channel 2 is FN, FN sensitive, analytics key events, pos:2, group:0, group mask:empty reporting: default 2: Host Switch Channel 3 , default: HostSwitch Channel 3 => HostSwitch Channel 3 is FN, FN sensitive, analytics key events, pos:3, group:0, group mask:empty reporting: default 3: Backlight Down , default: Backlight Down => Backlight Down is FN, FN sensitive, reprogrammable, divertable, analytics key events, pos:4, group:0, group mask:empty reporting: default 4: Backlight Up , default: Backlight Up => Backlight Up is FN, FN sensitive, reprogrammable, divertable, analytics key events, pos:5, group:0, group mask:empty reporting: default 5: Voice Dictation , default: Voice Dictation => Voice Dictation is FN, FN sensitive, reprogrammable, divertable, analytics key events, pos:6, group:0, group mask:empty reporting: default 6: Open Emoji Panel , default: Open Emoji Panel => Open Emoji Panel is FN, FN sensitive, reprogrammable, divertable, analytics key events, pos:7, group:0, group mask:empty reporting: diverted 7: Snipping Tool , default: Snipping Tool => Snipping Tool is FN, FN sensitive, reprogrammable, divertable, analytics key events, pos:8, group:0, group mask:empty reporting: default 8: Mute Microphone , default: Mute Microphone => Mute Microphone is FN, FN sensitive, reprogrammable, divertable, analytics key events, pos:9, group:0, group mask:empty reporting: default 9: Play/Pause Fn , default: Play/Pause => Play/Pause is FN, FN sensitive, reprogrammable, divertable, analytics key events, pos:10, group:0, group mask:empty reporting: default 10: Mute Fn , default: Mute => Mute is FN, FN sensitive, reprogrammable, divertable, analytics key events, pos:11, group:0, group mask:empty reporting: default 11: Volume Down Fn , default: Volume Down => Volume Down is FN, FN sensitive, reprogrammable, divertable, analytics key events, pos:12, group:0, group mask:empty reporting: default 12: Volume Up Fn , default: Volume Up => Volume Up nonstandard, reprogrammable, divertable, analytics key events, pos:13, group:0, group mask:empty reporting: default 13: Delete , default: Delete => Delete nonstandard, reprogrammable, divertable, analytics key events, pos:14, group:0, group mask:empty reporting: default 14: F Lock , default: Do Nothing One => Do Nothing One is FN, analytics key events, pos:0, group:0, group mask:empty reporting: default 15: FN Key , default: Do Nothing One => Do Nothing One nonstandard, analytics key events, pos:0, group:0, group mask:empty reporting: default Battery: 100%, 0. ```
``` - 1.1.13-17-gcece723e - _NAME: MX Keys Mini _absent: [hi-res-scroll, lowres-scroll-mode, hires-smooth-invert, hires-smooth-resolution, hires-scroll-mode, scroll-ratchet, smart-shift, thumb-scroll-invert, thumb-scroll-mode, onboard_profiles, report_rate, report_rate_extended, pointer_speed, dpi, dpi_extended, speed-change, backlight_level, backlight_duration_hands_out, backlight_duration_hands_in, backlight_duration_powered, backlight-timed, led_control, led_zone_, rgb_control, rgb_zone_, brightness_control, per-key-lighting, reprogrammable-keys, persistent-remappable-keys, crown-smooth, divert-crown, divert-gkeys, m-key-leds, mr-key-led, gesture2-gestures, gesture2-divert, gesture2-params, sidetone, equalizer, adc_power_management] _battery: 4100 _modelId: B36900000000 _sensitive: {backlight: true, change-host: false, disable-keyboard-keys: false, divert-keys: false, fn-swap: true, multiplatform: true} _unitId: 84917D97 backlight: 255 change-host: null disable-keyboard-keys: {1: false, 8: false, 16: false} divert-keys: {226: 0, 227: 0, 229: 0, 231: 0, 232: 0, 233: 0, 259: 0, 264: 1, 266: 0, 279: 0, 284: 0} fn-swap: true multiplatform: 3 ```

Describe the bug The brightness down F4 and up F5 does not decrease or increase the screen's brightness.

Screenshots

These are my rules

image

Additional context

Output of solaar -ddd when I press F4

``` 2024-06-01 14:01:23,629,629 DEBUG [SolaarListener:hidraw2] logitech_receiver.base: (13) => r[11 FF 0800 00E20000000000000000000000000000] 2024-06-01 14:01:23,629,629 DEBUG [SolaarListener:hidraw2] logitech_receiver.notifications: : notification for feature REPROG CONTROLS V4, report 0, data 00E20000000000000000000000000000 2024-06-01 14:01:23,629,629 DEBUG [SolaarListener:hidraw2] logitech_receiver.notifications: : diverted controls pressed: 0xe2, 0x0, 0x0, 0x0 2024-06-01 14:01:23,629,629 DEBUG [MainThread] logitech_receiver.diversion: evaluating rules on Notification(11,255,08,00,00E20000000000000000000000000000) 2024-06-01 14:01:23,629,629 DEBUG [MainThread] logitech_receiver.diversion: evaluate rule: Rule[Rule(/home/abeid/.config/solaar/rules.yaml)[], Rule[Rule[Rule[Key: Brightness Down (pressed), KeyPress: XF86_MonBrightnessDown click], Rule[Key: Brightness Up (pressed), KeyPress: XF86_MonBrightnessUp click]]]] 2024-06-01 14:01:23,629,629 DEBUG [MainThread] logitech_receiver.diversion: evaluate rule: Rule(/home/abeid/.config/solaar/rules.yaml)[] 2024-06-01 14:01:23,629,629 DEBUG [MainThread] logitech_receiver.diversion: evaluate rule: Rule[Rule[Rule[Key: Brightness Down (pressed), KeyPress: XF86_MonBrightnessDown click], Rule[Key: Brightness Up (pressed), KeyPress: XF86_MonBrightnessUp click]]] 2024-06-01 14:01:23,629,629 DEBUG [MainThread] logitech_receiver.diversion: evaluate rule: Rule[Rule[Key: Brightness Down (pressed), KeyPress: XF86_MonBrightnessDown click], Rule[Key: Brightness Up (pressed), KeyPress: XF86_MonBrightnessUp click]] 2024-06-01 14:01:23,629,629 DEBUG [MainThread] logitech_receiver.diversion: evaluate rule: Rule[Key: Brightness Down (pressed), KeyPress: XF86_MonBrightnessDown click] 2024-06-01 14:01:23,629,629 DEBUG [MainThread] logitech_receiver.diversion: evaluate condition: Key: Brightness Down (pressed) 2024-06-01 14:01:23,629,629 DEBUG [MainThread] logitech_receiver.diversion: evaluate rule: Rule[Key: Brightness Up (pressed), KeyPress: XF86_MonBrightnessUp click] 2024-06-01 14:01:23,629,629 DEBUG [MainThread] logitech_receiver.diversion: evaluate condition: Key: Brightness Up (pressed) 2024-06-01 14:01:23,673,673 DEBUG [SolaarListener:hidraw2] logitech_receiver.base: (13) => r[11 FF 0800 00000000000000000000000000000000] 2024-06-01 14:01:23,673,673 DEBUG [SolaarListener:hidraw2] logitech_receiver.notifications: : notification for feature REPROG CONTROLS V4, report 0, data 00000000000000000000000000000000 2024-06-01 14:01:23,673,673 DEBUG [SolaarListener:hidraw2] logitech_receiver.notifications: : diverted controls pressed: 0x0, 0x0, 0x0, 0x0 2024-06-01 14:01:23,673,673 DEBUG [MainThread] logitech_receiver.diversion: evaluating rules on Notification(11,255,08,00,00000000000000000000000000000000) 2024-06-01 14:01:23,673,673 DEBUG [MainThread] logitech_receiver.diversion: evaluate rule: Rule[Rule(/home/abeid/.config/solaar/rules.yaml)[], Rule[Rule[Rule[Key: Brightness Down (pressed), KeyPress: XF86_MonBrightnessDown click], Rule[Key: Brightness Up (pressed), KeyPress: XF86_MonBrightnessUp click]]]] 2024-06-01 14:01:23,673,673 DEBUG [MainThread] logitech_receiver.diversion: evaluate rule: Rule(/home/abeid/.config/solaar/rules.yaml)[] 2024-06-01 14:01:23,673,673 DEBUG [MainThread] logitech_receiver.diversion: evaluate rule: Rule[Rule[Rule[Key: Brightness Down (pressed), KeyPress: XF86_MonBrightnessDown click], Rule[Key: Brightness Up (pressed), KeyPress: XF86_MonBrightnessUp click]]] 2024-06-01 14:01:23,673,673 DEBUG [MainThread] logitech_receiver.diversion: evaluate rule: Rule[Rule[Key: Brightness Down (pressed), KeyPress: XF86_MonBrightnessDown click], Rule[Key: Brightness Up (pressed), KeyPress: XF86_MonBrightnessUp click]] 2024-06-01 14:01:23,673,673 DEBUG [MainThread] logitech_receiver.diversion: evaluate rule: Rule[Key: Brightness Down (pressed), KeyPress: XF86_MonBrightnessDown click] 2024-06-01 14:01:23,673,673 DEBUG [MainThread] logitech_receiver.diversion: evaluate condition: Key: Brightness Down (pressed) 2024-06-01 14:01:23,673,673 DEBUG [MainThread] logitech_receiver.diversion: evaluate rule: Rule[Key: Brightness Up (pressed), KeyPress: XF86_MonBrightnessUp click] 2024-06-01 14:01:23,673,673 DEBUG [MainThread] logitech_receiver.diversion: evaluate condition: Key: Brightness Up (pressed) ```

Note: I've set the OS to "Android" because the Screenshot (snipping) key F8 was not working on other OS platforms. Switching to "Android" fixed the issue.

pfps commented 5 months ago

The log shows that the key that is being depressed and released is 0xe2, not 0xc7 or 0xc8, which are the Brightness up and down keys. 0xe2 is Backlight Down.

My Craft keyboard has F1 as Brightness Down, F2 as Brightness Up, F6 as Backlight Down, and F7 as Backlight Up, but none of them generate any output when the keyboard is set to Windows. (There is no Android or Linux setting for my keyboard.)

So Solaar is doing what is should. The problem is mapping the icons on the keys to key names. For some keyboards this is problematic. Your keyboard is likely in the problematic situation where you need to look at the output of solaar show which gives the names of your F4 and F5 keys. See below for the excerpt.

       3: Backlight Down            , default: Backlight Down              => Backlight Down
             is FN, FN sensitive, reprogrammable, divertable, analytics key events, pos:4, group:0, group mask:empty
             reporting: default
         4: Backlight Up              , default: Backlight Up                => Backlight Up
             is FN, FN sensitive, reprogrammable, divertable, analytics key events, pos:5, group:0, group mask:empty
             reporting: default

(For some keyboards the marking on the key has no relationship to the name of the key. At least in your case the marking is likely something that might be considered to be related to light.)

abeidahmed commented 5 months ago

Thank you for the quick response. You're right. They weren't brightness keys as I had imagined.

The screenshot (snipping) F8 key only works when I set my OS to "Android". Is there a way I can make it work when I set the OS to "Windows"?

image

pfps commented 5 months ago

You probably would have to divert it and add a rule to do something with it, probably simulate the same key press as on Android.

abeidahmed commented 5 months ago

It worked. Thanks for your help. Appreciate it.

image