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

Keypress rules need to have the key diverted #2066

Closed Amolith closed 1 year ago

Amolith commented 1 year ago

Information

Describe the bug None of the rules I've written seem to be having any effect on the keys. The lines in the logs that make me suspicious are:

2023-05-09 12:02:26,162,162  WARNING [MainThread] hidapi.udev: Report Descriptor not processed for BID 0003 VID 00001050 PID 00000407: Expecting 8 usages but got 1
2023-05-09 12:02:26,162,162  WARNING [MainThread] hidapi.udev: Report Descriptor not processed for BID 0003 VID 00001050 PID 00000407: Expecting 64 usages but got 1

To Reproduce

  1. Install Solaar
  2. Grab the udev rules
  3. Write some Solaar rules
  4. Reboot computer
  5. Try to trigger rules
  6. Rules are not triggered

Additional context

My rules ``` %YAML 1.3 --- - Key: [MultiPlatform Search, pressed] - KeyPress: - [Super_L, z] - click ... --- - Key: [Snipping Tool, pressed] - KeyPress: - Print - click ... --- - Key: [Mute Microphone, pressed] - Execute: [amixer, set, Capture, toggle] ... ```
pfps commented 1 year ago

For Solaar rules to be triggered a device must send an HID++ notification. This only happens for key presses of regular keys when they are diverted using the Key/Button Diversion setting. It appears that you have not done this.

From https://pwr-solaar.github.io/Solaar/rules

Solaar’s rules only trigger on HID++ notifications so device actions that normally produce HID output have to be first be set (diverted) to produce HID++ notifications instead of their normal behavior. Currently Solaar can divert some mouse scroll wheels, some mouse thumb wheels, the crown of Craft keyboards, and some keys and buttons. If the scroll wheel, thumb wheel, crown, key, or button is not diverted by setting the appropriate setting then no HID++ notification is generated and rules will not be triggered by manipulating the wheel, crown, key, or button. Look for HID++ or Diversion settings to see what diversion can be done with your devices.

Amolith commented 1 year ago

It does look like those keys can be 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: MultiPlatform Search      , default: Multiplatform Search        => Multiplatform Search
             is FN, FN sensitive, reprogrammable, divertable, analytics key events, pos:10, group:0, group mask:empty
             reporting: default

But I don't see anything in the rules editor or GUI window about how to divert something. Have I also missed that in the docs?

pfps commented 1 year ago

Yes, the main Solaar window should have a Key/Button Diversion setting for your keyboard. You need to select the key you want to divert in the left-hand box and then select Diverted in the right-hand box.

Amolith commented 1 year ago

Aha I see how it works. Thank you for the help and sorry for wasting your time! :pray: