pwr-Solaar / Solaar

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

User-defined rules not working (because key not diverted) #1217

Closed m-zheng closed 3 years ago

m-zheng commented 3 years ago

Information

``` Unifying Receiver Device path : /dev/hidraw0 USB id : 046d:C52B Serial : EB85978E Firmware : 24.10.B0036 Bootloader : 01.08 Other : AA.AC Has 2 paired device(s) out of a maximum of 6. Notifications: wireless, software present (0x000900) Device activity counters: 1=181, 2=171 1: Wireless Mouse MX Master Device path : /dev/hidraw8 WPID : 4060 Codename : MX Master Kind : mouse Protocol : HID++ 4.5 Polling rate : 8 ms (125Hz) Serial number: 3394EF47 Model ID: B01740600000 Unit ID: E6063271 Bootloader: BOT 18.04.B0017 Firmware: MPM 11.04.B0017 Firmware: MPM 11.04.B0017 Other: The power switch is located on the base. Supports 31 HID++ 2.0 features: 0: ROOT {0000} 1: FEATURE SET {0001} 2: DEVICE FW VERSION {0003} Firmware: Bootloader BOT 18.04.B0017 40606F2F007E Firmware: Firmware MPM 11.04.B0017 B0176F2F007E Firmware: Firmware MPM 11.04.B0017 40606F2F007E Firmware: Other Unit ID: E6063271 Model ID: B01740600000 Transport IDs: {'btleid': 'B017', 'wpid': '4060'} 3: DEVICE NAME {0005} Name: Wireless Mouse MX Master Kind: mouse 4: WIRELESS DEVICE STATUS {1D4B} 5: RESET {0020} 6: BATTERY STATUS {1000} Battery: 90%, discharging, next level 50%. 7: CONFIG DEVICE PROPS {1806} internal, hidden 8: CHANGE HOST {1814} Change Host : 3:workstation 9: REPROG CONTROLS V4 {1B04} Key/Button Actions (saved): {'195': 195, '196': 196, '80': 80, '81': 81, '82': 82, '83': 83, '86': 86} Key/Button Actions : {'80': 80, '81': 81, '82': 82, '83': 83, '86': 86, '195': 195, '196': 196} 10: ADJUSTABLE DPI {2201} Sensitivity (DPI) (saved): 1000 Sensitivity (DPI) : 1000 11: VERTICAL SCROLLING {2100} Roller type: 3G Ratchet per turn: 24 Scroll lines: 0 12: SMART SHIFT {2110} Scroll Wheel Rachet (saved): 0 Scroll Wheel Rachet : 0 13: HIRES WHEEL {2121} Multiplier: 8 Has invert: Normal wheel motion Has ratchet switch: Free wheel mode High resolution mode HID notification Scroll Wheel Direction (saved): False Scroll Wheel Direction : False Scroll Wheel Resolution (saved): True Scroll Wheel Resolution : True 14: GESTURE 2 {6501} Gestures (saved): {'45': True, '46': True} Gestures : {'46': True, '45': True} 15: DFUCONTROL UNSIGNED {00C1} 16: unknown:1813 {1813} internal, hidden 17: unknown:1830 {1830} internal, hidden 18: unknown:1890 {1890} internal, hidden 19: unknown:1891 {1891} internal, hidden 20: unknown:18A1 {18A1} internal, hidden 21: unknown:18C0 {18C0} internal, hidden 22: unknown:1DF3 {1DF3} internal, hidden 23: unknown:1E00 {1E00} hidden 24: unknown:1EB0 {1EB0} internal, hidden 25: unknown:1803 {1803} internal, hidden 26: unknown:1861 {1861} internal, hidden 27: unknown:9000 {9000} internal, hidden 28: unknown:9200 {9200} internal, hidden 29: unknown:9240 {9240} internal, hidden 30: OOBSTATE {1805} internal, hidden Has 8 reprogrammable keys: 0: Left Button , default: Left Click => Left Click mse, pos:0, group:1, group mask:g1 reporting: default 1: Right Button , default: Right Click => Right Click mse, pos:0, group:1, group mask:g1 reporting: default 2: Middle Button , default: Mouse Middle Button => Mouse Middle Button mse, reprogrammable, divertable, raw XY, pos:0, group:3, group mask:g1,g2,g3 reporting: default 3: Back Button , default: Mouse Back Button => Mouse Back Button mse, reprogrammable, divertable, raw XY, pos:0, group:2, group mask:g1,g2 reporting: default 4: Forward Button , default: Mouse Forward Button => Mouse Forward Button mse, reprogrammable, divertable, raw XY, pos:0, group:2, group mask:g1,g2 reporting: default 5: Mouse Gesture Button , default: Gesture Button Navigation => Gesture Button Navigation mse, reprogrammable, divertable, raw XY, pos:0, group:3, group mask:g1,g2,g3 reporting: default 6: Smart Shift , default: Smart Shift => Smart Shift mse, reprogrammable, divertable, raw XY, pos:0, group:3, group mask:g1,g2,g3 reporting: default 7: Virtual Gesture Button , default: Virtual Gesture Button => Virtual Gesture Button divertable, virtual, raw XY, force raw XY, pos:0, group:4, group mask:empty reporting: default Has 2 gesture(s), 0 param(s) and 4 spec(s): Thumbwheel Enabled ( 0): True NaturalScrolling Enabled ( 1): True period unit Spec ( 3): 800 DVI field width Spec ( 1): 8 field widths Spec ( 2): 8 resolution Spec ( 4): 2048 Battery: 90%, discharging, next level 50%. 2: MX Keys Keyboard Device path : /dev/hidraw9 WPID : 408A Codename : MX Keys Kind : keyboard Protocol : HID++ 4.5 Polling rate : 20 ms (50Hz) Serial number: 32EAFC80 Model ID: B35B408A0000 Unit ID: 32EAFC80 Bootloader: BL1 08.00.B0011 Firmware: MPK 12.00.B0011 Other: The power switch is located on the edge of top right corner. Supports 33 HID++ 2.0 features: 0: ROOT {0000} 1: FEATURE SET {0001} 2: DEVICE FW VERSION {0003} Firmware: Bootloader BL1 08.00.B0011 00008169E8BB Firmware: Firmware MPK 12.00.B0011 408A8169E8BB Firmware: Other Unit ID: 32EAFC80 Model ID: B35B408A0000 Transport IDs: {'btleid': 'B35B', 'wpid': '408A'} 3: DEVICE NAME {0005} Name: MX Keys Wireless Keyboard Kind: keyboard 4: WIRELESS DEVICE STATUS {1D4B} 5: RESET {0020} 6: DEVICE FRIENDLY NAME {0007} 7: BATTERY STATUS {1000} Battery: 100%, discharging, next level 50%. 8: REPROG CONTROLS V4 {1B04} 9: CHANGE HOST {1814} Change Host : 3:workstation 10: HOSTS INFO {1815} Host 0 (paired): BB8 Host 1 (paired): C3PO Host 2 (paired): workstation 11: BACKLIGHT2 {1982} Backlight (saved): False Backlight : False 12: K375S FN INVERSION {40A3} Swap Fx function (saved): False Swap Fx function : False 13: ENCRYPTION {4100} 14: LOCK KEY STATE {4220} 15: KEYBOARD DISABLE KEYS {4521} Disable keys (saved): {'1': False, '16': False, '2': False, '4': False, '8': False} Disable keys : {'1': False, '2': False, '4': False, '8': False, '16': False} 16: MULTIPLATFORM {4531} Set OS (saved): 0 Set OS : Windows 17: DFUCONTROL SIGNED {00C2} 18: DEVICE RESET {1802} internal, hidden 19: unknown:1803 {1803} internal, hidden 20: CONFIG DEVICE PROPS {1806} internal, hidden 21: unknown:1813 {1813} internal, hidden 22: OOBSTATE {1805} internal, hidden 23: unknown:1830 {1830} internal, hidden 24: unknown:1890 {1890} internal, hidden 25: unknown:1891 {1891} internal, hidden 26: unknown:18A1 {18A1} internal, hidden 27: unknown:1DF3 {1DF3} internal, hidden 28: unknown:1E00 {1E00} hidden 29: unknown:1EB0 {1EB0} internal, hidden 30: unknown:1861 {1861} internal, hidden 31: unknown:1A20 {1A20} internal, hidden 32: unknown:18B0 {18B0} internal, hidden Has 24 reprogrammable keys: 0: Host Switch Channel 1 , default: HostSwitch Channel 1 => HostSwitch Channel 1 nonstandard, divertable, persistently divertable, analytics key events, pos:0, group:0, group mask:empty reporting: default 1: Host Switch Channel 2 , default: HostSwitch Channel 2 => HostSwitch Channel 2 nonstandard, divertable, persistently divertable, analytics key events, pos:0, group:0, group mask:empty reporting: default 2: Host Switch Channel 3 , default: HostSwitch Channel 3 => HostSwitch Channel 3 nonstandard, divertable, persistently divertable, analytics key events, pos:0, group:0, group mask:empty reporting: default 3: Brightness Down , default: Brightness Down => Brightness Down is FN, FN sensitive, reprogrammable, divertable, persistently divertable, analytics key events, pos:1, group:0, group mask:empty reporting: default 4: Brightness Up , default: Brightness Up => Brightness Up is FN, FN sensitive, reprogrammable, divertable, persistently divertable, analytics key events, pos:2, group:0, group mask:empty reporting: default 5: Mission Control/Task View , default: Mission Control/Task View => Mission Control/Task View is FN, FN sensitive, reprogrammable, divertable, persistently divertable, analytics key events, pos:3, group:0, group mask:empty reporting: default 6: Dashboard Launchpad/Action Center, default: Dashboard Launchpad/Action Center => Dashboard Launchpad/Action Center is FN, FN sensitive, reprogrammable, divertable, persistently divertable, analytics key events, pos:4, group:0, group mask:empty reporting: default 7: Show Desktop , default: Show Desktop => Show Desktop is FN, FN sensitive, reprogrammable, divertable, persistently divertable, analytics key events, pos:5, group:0, group mask:empty reporting: default 8: Backlight Down , default: Backlight Down => Backlight Down is FN, FN sensitive, reprogrammable, divertable, persistently divertable, analytics key events, pos:6, group:0, group mask:empty reporting: default 9: Backlight Up , default: Backlight Up => Backlight Up is FN, FN sensitive, reprogrammable, divertable, persistently divertable, analytics key events, pos:7, group:0, group mask:empty reporting: default 10: Previous Fn , default: Previous => Previous is FN, FN sensitive, reprogrammable, divertable, persistently divertable, analytics key events, pos:8, group:0, group mask:empty reporting: default 11: Play/Pause Fn , default: Play/Pause => Play/Pause is FN, FN sensitive, reprogrammable, divertable, persistently divertable, analytics key events, pos:9, group:0, group mask:empty reporting: default 12: Next Fn , default: Next => Next is FN, FN sensitive, reprogrammable, divertable, persistently divertable, analytics key events, pos:10, group:0, group mask:empty reporting: default 13: Mute Fn , default: Mute => Mute is FN, FN sensitive, reprogrammable, divertable, persistently divertable, analytics key events, pos:11, group:0, group mask:empty reporting: default 14: Volume Down Fn , default: Volume Down => Volume Down is FN, FN sensitive, reprogrammable, divertable, persistently divertable, analytics key events, pos:12, group:0, group mask:empty reporting: default 15: Volume Up Fn , default: Volume Up => Volume Up nonstandard, reprogrammable, divertable, persistently divertable, analytics key events, pos:0, group:0, group mask:empty reporting: default 16: Calculator , default: Calculator => Calculator nonstandard, reprogrammable, divertable, persistently divertable, analytics key events, pos:0, group:0, group mask:empty reporting: default 17: Screen Capture/Print Screen, default: Screen Capture => Screen Capture nonstandard, reprogrammable, divertable, persistently divertable, analytics key events, pos:0, group:0, group mask:empty reporting: default 18: App Contextual Menu/Right Click, default: Right Click/App Contextual Menu => Right Click/App Contextual Menu nonstandard, reprogrammable, divertable, persistently divertable, analytics key events, pos:0, group:0, group mask:empty reporting: default 19: Lock PC , default: WindowsLock => WindowsLock nonstandard, reprogrammable, divertable, persistently divertable, analytics key events, pos:0, group:0, group mask:empty reporting: default 20: Left Arrow , default: Keyboard Left Arrow => Keyboard Left Arrow nonstandard, divertable, persistently divertable, analytics key events, pos:0, group:0, group mask:empty reporting: default 21: Right Arrow , default: Keyboard Right Arrow => Keyboard Right Arrow nonstandard, divertable, persistently divertable, analytics key events, pos:0, group:0, group mask:empty reporting: default 22: F Lock , default: Do Nothing One => Do Nothing One is FN, analytics key events, pos:0, group:0, group mask:empty reporting: default 23: unknown:0034 , default: Do Nothing One => Do Nothing One nonstandard, analytics key events, pos:0, group:0, group mask:empty reporting: default Battery: 100%, discharging, next level 50%. ```

Describe the bug I am trying to reprogram the calculator key in MX keys to execute /usr/bin/qalculate. I have added a new rule but somehow it doesn't work. For some reasons, all user-defined rules are working for MX keys.

Solaar was installed by

sudo apt-get install python3-pyudev
sudo apt-get install python3-psutil
sudo apt-get install python3-xlib
sudo apt-get install python3-yaml
sudo apt-get install python3-pyyaml
sudo apt-get install python3-gi
sudo apt-get install gir1.2-gtk-3.0
sudo apt-get install python3-gi
sudo apt install gir1.2-notify-0.7
sudo apt install gir1.2-ayatanaappindicator3-0.1
sudo apt install gir1.2-appindicator3-0.1

sudo add-apt-repository ppa:solaar-unifying/stable
sudo apt-get update
sudo apt install solaar

To Reproduce Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Screenshots

Screenshot from 2021-07-29 10-22-16

Additional context Add any other context about the problem here.

pfps commented 3 years ago

It looks as if you do not have any keys diverted. Solaar rules are only sensitive to notification messages from devices and keys only produce notification messages when they are diverted.

In the Solaar main window, select the key you want to trigger a rule in the Key/Button Diversion setting and change it to "Diverted". Then your Solaar rule should work for that key.

I would suggest, however, using your window manager to do this sort of thing unless there is some reason that it cannot. Of course, if you want a more complex rule then the window manager solution will likely not be possible.

m-zheng commented 3 years ago

Thanks, mate!. You are right. Solaar rules must be used along with the Key/Button Diversion set to Diverted in the main page. All sorted now.