Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Help wanted, needs to find a way to identify a mouse gesture and a key press. #2726

Open
zzj0311 opened this issue Dec 24, 2024 · 3 comments

Comments

@zzj0311
Copy link

zzj0311 commented Dec 24, 2024

Information

  • Solaar version (solaar --version and git describe --tags):solaar 1.1.11+dfsg-2
  • Distribution: ubuntu 24.04, Gnome, X11 enabled
  • Kernel version (ex. uname -srmo):Linux 6.8.0-51-generic x86_64 GNU/Linux
  • Output of solaar show for the target device (if applicable):
solaar version 1.1.11+dfsg-2

优联接收器
  Device path  : /dev/hidraw1
  USB id       : 046d:C52B
  Serial       : 767490B8
    Firmware   : 24.11.B0036
    Bootloader : 03.09
    Other      : AA.AD
  Has 3 paired device(s) out of a maximum of 6.
  Notifications: wireless, software present (0x000900)
  Device activity counters: 1=152

  1: Wireless Mobile Mouse MX Anywhere 2S
     Device path  : /dev/hidraw2
     WPID         : 406A
     Codename     : MX Anywhere 2S
     Kind         : mouse
     Protocol     : HID++ 4.5
     Report Rate : 8msms
     Serial number: A615D25D
     Model ID:      B01A406A0000
     Unit ID:       A654D237
        Bootloader: BOT 57.00.B0003
          Firmware: MPM 13.00.B0003
          Firmware: MPM 13.00.B0003
             Other: 
     The power switch is located on the base.
     Supports 28 HID++ 2.0 features:
         0: ROOT                   {0000} V0     
         1: FEATURE SET            {0001} V0     
         2: DEVICE FW VERSION      {0003} V2     
            Firmware: Bootloader BOT 57.00.B0003 406AD22DCF4D01
            Firmware: Firmware MPM 13.00.B0003 B01AD22DCF4D01
            Firmware: Firmware MPM 13.00.B0003 406AD22DCF4D01
            Firmware: Other   
            Unit ID: A654D237  Model ID: B01A406A0000  Transport IDs: {'btleid': 'B01A', 'wpid': '406A'}
         3: DEVICE NAME            {0005} V0     
            Name: Wireless Mobile Mouse MX Anywhere 2S
            Kind: mouse
         4: WIRELESS DEVICE STATUS {1D4B} V0     
         5: CONFIG CHANGE          {0020} V0     
         6: BATTERY STATUS         {1000} V0     
            Battery: 90%, discharging, next level 50%.
         7: CONFIG DEVICE PROPS    {1806} V0    internal, hidden 
         8: CHANGE HOST            {1814} V1     
            改变主机        : 1:zzj
         9: REPROG CONTROLS V4     {1B04} V3     
            按键/按钮操作 (saved): {Left Button:Left Click, Right Button:Right Click, Middle Button:Gesture Button Navigation, Back Button:Mouse Back Button, Forward Button:Mouse Forward Button, Left Tilt:Mouse Scroll Left Button , Right Tilt:Mouse Scroll Right Button}
            按键/按钮操作        : {Left Button:Left Click, Right Button:Right Click, Middle Button:Gesture Button Navigation, Back Button:Mouse Back Button, Forward Button:Mouse Forward Button, Left Tilt:Mouse Scroll Left Button , Right Tilt:Mouse Scroll Right Button}
            按键/按钮改道 (saved): {Middle Button:鼠标手势, Back Button:鼠标手势, Forward Button:鼠标手势, Left Tilt:鼠标手势, Right Tilt:常规}
            按键/按钮改道        : {Middle Button:改道, Back Button:改道, Forward Button:改道, Left Tilt:改道, Right Tilt:常规}
        10: ADJUSTABLE DPI         {2201} V1     
            灵敏度 (DPI) (saved): 1000
            灵敏度 (DPI)        : 1000
        11: VERTICAL SCROLLING     {2100} V0     
            Roller type: 3G
            Ratchet per turn: 24
            Scroll lines: 0
        12: HIRES WHEEL            {2121} V0     
            Multiplier: 8
            Has invert: Normal wheel motion
            Has ratchet switch: Normal wheel mode
            High resolution mode
            HID notification
            滚轮方向 (saved): False
            滚轮方向        : False
            滚轮分辨率 (saved): True
            滚轮分辨率        : True
            滚轮改道 (saved): False
            滚轮改道        : False
        13: DFUCONTROL UNSIGNED    {00C1} V0     
        14: DFUCONTROL SIGNED      {00C2} V0     
        15: unknown:1813           {1813} V0    internal, hidden 
        16: unknown:1830           {1830} V0    internal, hidden 
        17: unknown:1890           {1890} V0    internal, hidden 
        18: unknown:1891           {1891} V0    internal, hidden 
        19: unknown:18A1           {18A1} V0    internal, hidden 
        20: unknown:18C0           {18C0} V0    internal, hidden 
        21: unknown:1DF3           {1DF3} V0    internal, hidden 
        22: unknown:1E00           {1E00} V0    hidden 
        23: unknown:1EB0           {1EB0} V0    internal, hidden 
        24: unknown:1803           {1803} V0    internal, hidden 
        25: unknown:1861           {1861} V0    internal, hidden 
        26: unknown:9001           {9001} V0    internal, hidden 
        27: OOBSTATE               {1805} V0    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: Gesture Button Navigation   => Gesture Button Navigation 
             mse, reprogrammable, divertable, raw XY, pos:0, group:2, group mask:g1,g2,g4
             reporting: diverted, raw XY diverted
         3: Back Button               , default: Mouse Back Button           => Mouse Back Button         
             mse, reprogrammable, divertable, raw XY, pos:0, group:3, group mask:g1,g2,g3,g4
             reporting: diverted, raw XY diverted
         4: Forward Button            , default: Mouse Forward Button        => Mouse Forward Button      
             mse, reprogrammable, divertable, raw XY, pos:0, group:3, group mask:g1,g2,g3,g4
             reporting: diverted, raw XY diverted
         5: Left Tilt                 , default: Mouse Scroll Left Button    => Mouse Scroll Left Button  
             mse, reprogrammable, divertable, raw XY, pos:0, group:3, group mask:g1,g2,g3,g4
             reporting: diverted, raw XY diverted
         6: Right Tilt                , default: Mouse Scroll Right Button   => Mouse Scroll Right Button 
             mse, reprogrammable, divertable, raw XY, pos:0, group:3, group mask:g1,g2,g3,g4
             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
     Battery: 90%, discharging, next level 50%.

  2: Wireless Mouse MX Master 2S
     Device path  : /dev/hidraw3
     WPID         : 4069
     Codename     : MX Master 2S
     Kind         : mouse
     Protocol     : HID++ 4.5
     Report Rate : 8msms
     Serial number: 4BEDC020
     The power switch is located on the base.
     Battery: unknown (device is offline).

  4: Wireless Mouse MX Master 2S
     Device path  : /dev/hidraw4
     WPID         : 4069
     Codename     : MX Master 2S
     Kind         : mouse
     Protocol     : HID++ 4.5
     Report Rate : 8msms
     Serial number: 9D482C9C
     The power switch is located on the base.
     Battery: unknown (device is offline).

Is your feature request related to a problem? Please describe.
I'm new to the solaar and just got my hand dirty to replicate my windows config to my new linux machine. I'm now frustrate on the mouse gesture setting. What I want is one like what logi does on windows(and mac of course) that one key can represents five action which are: mouse left, mouse right, mouse up mouse down and key press. I wrote the yaml as follow since the manual says that 'If the last thing that a rule does is execute an action, no more rules are processed for the notification.'

---
- And:
  - MouseGesture: Mouse Right
  - Key: [Back Button, released]
  - Or:
    - Process: code
    - Process: chrome
  - KeyPress:
    - [Control_L, Tab]
    - click
...
---
- And:
  - MouseGesture: Mouse Left
  - Key: [Back Button, released]
  - Or:
    - Process: code
    - Process: chrome
  - KeyPress:
    - [Control_L, Shift_L, Tab]
    - click
...
---
- And:
  - Key: [Back Button, released]
  - Or:
    - Process: code
    - Process: chrome
  - KeyPress:
    - [Control_L, t]
    - click
...

however, this approach is quiet unstable, in most cases, it would does the 'jump to next/prev tab' and 'create new tab' for chrome at the same time, and what I want is that after process the mouse gesture, solarr should not process the following rules, meaning it should not 'create new tab' when the keypress action is done.
A solaar -ddd output sample for the gesture shared in file

Describe the solution you'd like
One notification should only excute the first hit rule, and no more following rules after.

Describe alternatives you've considered
Maybe add an action that can end the rule process or a tag for test?

Additional context
Seems enough.

@pfps
Copy link
Collaborator

pfps commented Dec 24, 2024

Solaar only processes one notification at a time, the first two rules require two - a mouse gesture and a key release. So they will never fire.

@zzj0311
Copy link
Author

zzj0311 commented Dec 25, 2024

hmmm, first thing, the first two, they actually works perfect on my machine if the last one not added, if that's not the defined behavior. One other thing to notice is that the following rule is not working so maybe that's your designed behavior:

---
- And:
  - MouseGesture: Mouse Right
  - Key: [Back Button, pressed]
  - Or:
    - Process: code
    - Process: chrome
  - KeyPress:
    - [Control_L, Tab]
    - click
...

So how can I achieve my purpose then? what I want is to assign back button for one group of mouse gesture and middle button for another.

@pfps
Copy link
Collaborator

pfps commented Dec 25, 2024

You could use KeyIsDown conditions, provided that the key is diverted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants