pwr-Solaar / Solaar

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

Multiple rules profiles/layers/sets #2191

Open Flashwalker opened 10 months ago

Flashwalker commented 10 months ago

Is it posible to implement multiple profiles/layers/sets of rules? So you can cycle between them with a remaped/diverted button?

It's like with A4tech mouse where you can switch onboard programmed layers via top button behind the wheel ("Smart Shift button in the case of Logitech MX Master")

Information

solaar version 1.1.9+git2025-4160b0e

USB and Bluetooth Devices

  1: MX Master 3S
     Device path  : /dev/hidraw4
     USB id       : 046d:B034
     Codename     : MX Master 3S
     Kind         : mouse
     Protocol     : HID++ 4.5
     Serial number: 
     Model ID:      B03400000000
     Unit ID:       934AC90A
        Bootloader: BL1 69.00.B0003
          Firmware: RBM 22.00.B0003
             Other: 
     Supports 36 HID++ 2.0 features:
         0: ROOT                   {0000} V0     
         1: FEATURE SET            {0001} V0     
         2: DEVICE FW VERSION      {0003} V4     
            Firmware: Bootloader BL1 69.00.B0003 B03438FCA4E6
            Firmware: Firmware RBM 22.00.B0003 B03438FCA4E6
            Firmware: Other   
            Unit ID: 934AC90A  Model ID: B03400000000  Transport IDs: {'btleid': 'B034'}
         3: DEVICE NAME            {0005} V0     
            Name: MX Master 3S
            Kind: mouse
         4: WIRELESS DEVICE STATUS {1D4B} V0     
         5: CONFIG CHANGE          {0020} V0     
         6: CRYPTO ID              {0021} V1     
         7: DEVICE FRIENDLY NAME   {0007} V0     
            Friendly Name: MX Master 3S
         8: UNIFIED BATTERY        {1004} V3     
            Battery: 75%, discharging.
         9: REPROG CONTROLS V4     {1B04} V5     
            Key/Button Actions (saved): {Left Button:Left Click, Right Button:Right Click, Middle Button:Mouse Middle Button, Back Button:Mouse Back Button, Forward Button:Mouse Forward Button, Mouse Gesture Button:Gesture Button Navigation, Smart Shift:Smart Shift}
            Key/Button Actions        : {Left Button:Left Click, Right Button:Right Click, Middle Button:Mouse Middle Button, Back Button:Mouse Back Button, Forward Button:Mouse Forward Button, Mouse Gesture Button:Gesture Button Navigation, Smart Shift:Smart Shift}
            Key/Button Diversion (saved): {Middle Button:Regular, Back Button:Diverted, Forward Button:Diverted, Mouse Gesture Button:Regular, Smart Shift:Regular}
            Key/Button Diversion        : {Middle Button:Regular, Back Button:Diverted, Forward Button:Diverted, Mouse Gesture Button:Regular, Smart Shift:Regular}
        10: CHANGE HOST            {1814} V1     
            Change Host        : 2:smarttop
        11: HOSTS INFO             {1815} V2     
            Host 0 (paired): Logitech Bolt receiver
            Host 1 (paired): smarttop
            Host 2 (paired): smarttop
        12: XY STATS               {2250} V1     
        13: ADJUSTABLE DPI         {2201} V2     
            Sensitivity (DPI) (saved): 1000
            Sensitivity (DPI)        : 1000
        14: SMART SHIFT            {2110} V0     
            Scroll Wheel Ratcheted (saved): Ratcheted
            Scroll Wheel Ratcheted        : Ratcheted
            Scroll Wheel Ratchet Speed (saved): 10
            Scroll Wheel Ratchet Speed        : 10
        15: HIRES WHEEL            {2121} V1     
            Multiplier: 15
            Has invert: Normal wheel motion
            Has ratchet switch: Normal 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
            Scroll Wheel Diversion (saved): False
            Scroll Wheel Diversion        : False
        16: THUMB WHEEL            {2150} V0     
            Thumb Wheel Direction (saved): False
            Thumb Wheel Direction        : False
            Thumb Wheel Diversion (saved): False
            Thumb Wheel Diversion        : False
        17: WHEEL STATS            {2251} V0     
        18: DFUCONTROL             {00C3} V0     
        19: DEVICE RESET           {1802} V0    internal, hidden, unknown:000010 
        20: unknown:1803           {1803} V0    internal, hidden, unknown:000010 
        21: CONFIG DEVICE PROPS    {1806} V8    internal, hidden, unknown:000010 
        22: unknown:1816           {1816} V0    internal, hidden, unknown:000010 
        23: OOBSTATE               {1805} V0    internal, hidden 
        24: unknown:1830           {1830} V0    internal, hidden, unknown:000010 
        25: unknown:1891           {1891} V7    internal, hidden, unknown:000008 
        26: unknown:18A1           {18A1} V0    internal, hidden, unknown:000010 
        27: unknown:1E00           {1E00} V0    hidden 
        28: unknown:1E02           {1E02} V0    internal, hidden 
        29: unknown:1602           {1602} V0     
        30: unknown:1EB0           {1EB0} V0    internal, hidden, unknown:000010 
        31: unknown:1861           {1861} V1    internal, hidden, unknown:000010 
        32: unknown:9300           {9300} V0    internal, hidden, unknown:000010 
        33: unknown:9001           {9001} V0    internal, hidden, unknown:000010 
        34: unknown:1E22           {1E22} V0    internal, hidden, unknown:000010 
        35: unknown:9205           {9205} V0    internal, hidden, unknown:000010 
     Has 8 reprogrammable keys:
         0: Left Button               , default: Left Click                  => Left Click                
             mse, analytics key events, pos:0, group:1, group mask:g1
             reporting: default
         1: Right Button              , default: Right Click                 => Right Click               
             mse, analytics key events, pos:0, group:1, group mask:g1
             reporting: default
         2: Middle Button             , default: Mouse Middle Button         => Mouse Middle Button       
             mse, reprogrammable, divertable, raw XY, analytics key events, pos:0, group:2, group mask:g1,g2
             reporting: default
         3: Back Button               , default: Mouse Back Button           => Mouse Back Button         
             mse, reprogrammable, divertable, raw XY, analytics key events, pos:0, group:2, group mask:g1,g2
             reporting: diverted
         4: Forward Button            , default: Mouse Forward Button        => Mouse Forward Button      
             mse, reprogrammable, divertable, raw XY, analytics key events, pos:0, group:2, group mask:g1,g2
             reporting: diverted
         5: Mouse Gesture Button      , default: Gesture Button Navigation   => Gesture Button Navigation 
             mse, reprogrammable, divertable, raw XY, analytics key events, pos:0, group:2, group mask:g1,g2
             reporting: default
         6: Smart Shift               , default: Smart Shift                 => Smart Shift               
             mse, reprogrammable, divertable, raw XY, analytics key events, pos:0, group:2, group mask:g1,g2
             reporting: default
         7: Virtual Gesture Button    , default: Virtual Gesture Button      => Virtual Gesture Button    
             divertable, virtual, raw XY, force raw XY, pos:0, group:3, group mask:empty
             reporting: default
     Battery: 75%, discharging.

pfps commented 10 months ago

This is neither possible right now nor planned.

Flashwalker commented 10 months ago

This is neither possible right now nor planned.

Sad to hear. At least can we have toggles for rules? Something like this:
rules-toggle-feature

pfps commented 10 months ago

This will likely not happen unless someone does the implementation work. Similarly, rule profiles would be possible if someone does the implementation work.

Flashwalker commented 10 months ago

I see. By the way, perhaps the input-remapper project would be a good inspiration. It supports rule sets. The only drawback is the lack of Logi Bolt support. UPD: With another one MX Master 3S connected via Logi Bolt receiver i was able to remap keys via input-remapper as well as connected via bluetooth. I also implemented the cycling through layers on gesture button click

MattHag commented 8 months ago

Instead of profiles, program dependent key/gestures configurations would be really awesome. Same as Logi Options+ already has.

pfps commented 8 months ago

Solaar can partly do program-dependent remapping using rules, but under X11 only, as Wayland does not allow access to this information.

Solaar cannot be as powerful as the Logitech software, which can interact directly with the Logitech drivers.

NXTler commented 6 months ago

I mean, the only thing that is needed to have toggle buttons for layers/profiles, is someway to store and read values in rules. Here is an example how a simple toggle would look like: when x is pressed and y is 0, output action 1 | when z is pressed and y is 0, change y to 1 | when x is pressed and y is 1, output action 2 | when z is pressed and y is 1, change y to 0 x is some button for your actions y is a variable to store some value z is some button that acts like a toggle button through y

I already do this with my dpi settings, switching through 3 levels with a single button.

pfps commented 3 months ago

Yes, the ability to save and check values would do this. There is a separate request to allow for execution of Python code which would also allow this. See #2492

Flashwalker commented 3 months ago

I wrote a little script for input-remapper (gist) to be able to toggle the buttons actions