PixlOne / logiops

An unofficial userspace driver for HID++ Logitech devices
GNU General Public License v3.0
3.42k stars 271 forks source link

Configuring thumbwheel gestures #332

Open aleemont opened 2 years ago

aleemont commented 2 years ago

Hi I'm trying to configure my MX Master 3, but it seems like it's not possibile to bind gestures (with directions) to the thumbwheel actions (tap, touch, proxy). Is there any way to do this?

cat /etc/logid.cfg

// Tested on logid v0.2.3 - KDE Plasma 5.25.5 (Wayland) - Arch Linux

// What's not working:

//   1. thumbwheel gestures

// File location: /etc/logid.cfg

devices: ({
  name: "Wireless Mouse MX Master 3";

  smartshift: {
    on: true;
    threshold: 14;
  };

  hiresscroll: {
    hires: true;
    invert: false;
    target: false;
  };

  dpi: 1350; // max=4000
  buttons: (
    //Forward btn 
    {
        cid: 0x56;
        action = {
            type: "Gestures";
            gestures: (
                {
                    direction: "None";
                    mode: "OnRelease";
                    action = {
                        type: "Keypress";
                        keys: [ "KEY_FORWARD" ];
                    }
                },
                {
                    interval: 5;
                    threshold: 3;
                    direction: "Right";
                    mode: "OnInterval";
                    action = {
                    type: "Keypress";
                    keys: [ "KEY_BRIGHTNESSUP" ];
                    }
                },
                {
                    interval: 5;
                    threshold: 3;
                    direction: "Left";
                    mode: "OnInterval";
                    action = {
                    type: "Keypress";
                    keys: [ "KEY_BRIGHTNESSDOWN" ];
                    }
                }
            );
        };
    },
    //Back btn 
    {
        cid: 0x53;
        action = {
            type: "Gestures";
            gestures: (
                {
                    direction: "None";
                    mode: "OnRelease";
                    action = {
                        type: "Keypress";
                        keys: [ "KEY_BACK" ];
                    }
                },
                {
                    direction: "Up";
                    mode: "OnRelease";
                    action = {
                        type: "Keypress";
                        keys: [ "KEY_PLAYPAUSE" ];
                    }
                },
                {
                    direction: "Down";
                    mode: "OnRelease";
                    action = {
                        type: "Keypress";
                        keys: [ "KEY_MUTE" ];
                    }
                },
                {
                    direction: "Left";
                    mode: "OnRelease";
                    action = {
                        type: "Keypress";
                        keys: [ "KEY_PREVIOUSSONG" ];
                    }
                },
                {
                    direction: "Right";
                    mode: "OnRelease";
                    action = {
                        type: "Keypress";
                        keys: [ "KEY_NEXTSONG" ];
                    }
                }
            );
        };
    },
    //Gestures btn 
    {
        cid: 0xc3;
        action = {
            type: "Gestures";
            gestures: (
                {
                    direction: "None";
                    mode: "OnRelease";
                    action = {
                        type: "Keypress";
                        keys: [ "KEY_LEFTMETA", "KEY_TAB" ];
                    }
                },
                {
                    direction: "Up";
                    mode: "OnRelease";
                    action = {
                        type: "Keypress";
                        keys: [ "KEY_LEFTMETA", "KEY_UP" ];
                    }
                },
                {
                    direction: "Down";
                    mode: "OnRelease";
                    action = {
                        type: "Keypress";
                        keys: [ "KEY_LEFTMETA", "KEY_LEFTSHIFT", "KEY_W" ];
                    }
                },
                {
                    direction: "Left";
                    mode: "OnRelease";
                    action = {
                        type: "Keypress";
                        keys: [ "KEY_LEFTMETA", "KEY_LEFT" ];
                    }
                },
                {
                    direction: "Right";
                    mode: "OnRelease";
                    action = {
                        type: "Keypress";
                        keys: [ "KEY_LEFTMETA", "KEY_RIGHT" ];
                    }
                }
            );
        };
    },
    //Top btn 
    {
        cid: 0xc4;
        action = {
            type: "Gestures";
            gestures: (
                {
                    direction: "None";
                    mode: "OnRelease";
                    action = {
                        type: "ToggleSmartShift";
                    }
                },
                {
                    direction: "Up";
                    mode: "OnRelease";
                    action = {
                        type: "ChangeDPI";
                        inc: 200;
                    }
                },
                {
                    direction: "Down";
                    mode: "OnRelease";
                    action = {
                        type: "ChangeDPI";
                        inc: -200;
                    }
                },
            );
        };
    },
  ),
  thumbwheel:
    {
        divert: true;
        invert: false;
        left:
        {
            threshold: 1;
            interval: 1;
            direction: "Left";
            mode: "OnInterval";
            action =
            {
                type: "Keypress";
                keys: ["KEY_VOLUMEDOWN"];
            };
        };
        right:
        {
            threshold: 1;
            interval: 1;
            direction: "Right";
            mode: "OnInterval";
            action =
            {
                type: "Keypress";
                keys: ["KEY_VOLUMEUP"];
            };
        };

        }
        touch:
         {       
             action = {
                type: "Gestures";
                gestures:       (
                   {
                      //threshold: 1;
                      //interval: 1;
                      direction: "Up";
                      mode: "OnRelease";
                      action = {
                         type: "Keypress";
                         keys: ["KEY_LEFTCTRL", "KEY_KPPLUS"];
                      }
                   },
                   {
                      //threshold: 1;
                      //interval: 1;
                      direction: "Down";
                      mode: "OnRelease";
                      action =  {
                         type: "Keypress";
                         keys: ["KEY_LEFTCTRL", "KEY_KPMINUS"];
                      }
                   },
                );
            };
        };
    }
)

systemctl status logid.service

     Loaded: loaded (/usr/lib/systemd/system/logid.service; enabled; preset: disabled)
     Active: active (running) since Thu 2022-09-22 11:02:02 CEST; 13min ago
   Main PID: 22599 (logid)
      Tasks: 7 (limit: 18418)
     Memory: 736.0K
        CPU: 439ms
     CGroup: /system.slice/logid.service
             └─22599 /usr/bin/logid

Sep 22 11:02:02 altair systemd[1]: Started Logitech Configuration Daemon.
xathon commented 1 year ago

I have the same problem, and have been unable to fix it, unfortunately.

MatinEbrahimkhani commented 1 week ago

hey @aleemont @xathon I created this configuration for myself and it works perfectly with Master 3S feel free to tweak it for yourself or ask questions about it

devices: (
  {
    name: "MX Master 3S";
    smartshift: {
      on: true;
      threshold: 20;
    };
    hiresscroll: {
      hires: true;
      invert: false;
      target: false;
    };
    dpi: 1500; // max=4000
    buttons: (
      {
        cid: 0x56; // Forward button
        action = {
          type: "Gestures";
          gestures: (
              {
                direction: "None",
                mode: "OnRelease",
                action: {
                  type: "Keypress",
                  keys: ["KEY_FORWARD"]
                }
              },
              {
                direction: "Down",
                mode: "OnRelease",
                action: {
                  type: "Keypress",
                  keys: ["KEY_COPY"]
                }
              },
              {
                direction: "Up",
                mode: "OnRelease",
                action: {
                  type: "Keypress",
                  keys: ["KEY_PASTE"]
                }
              }
         )
        }  
      },
      {
        cid: 0x53; // Back button
        action = { type: "Gestures"; gestures: ( { direction: "None"; mode: "OnRelease"; action = { type: "Keypress"; keys: ["KEY_BACK"]; } } ); };
      },
      {
        cid: 0xc3; // Thumb button
        action = {
          type: "Gestures";
          gestures: (
            {
              direction: "Up";
             mode: "OnInterval";
            threshold: 1;
            interval: 100;
            action = {
              type: "Keypress";
              keys: [ "KEY_VOLUMEUP" ]; // Volume Up
              };
            },
            {
              direction: "Down";
             mode: "OnInterval";
            threshold: 1;
            interval: 100;
            action = {
              type: "Keypress";
              keys: [ "KEY_VOLUMEDOWN" ]; // Volume Down
              };
            },
            {
              direction: "Left";
              mode: "OnRelease";
              action = {
                type: "Keypress";
                keys: ["KEY_PREVIOUSSONG"];
              };
            },
            {
              direction: "Right";
              mode: "OnRelease";
              action = {
                type: "Keypress";
                keys: ["KEY_NEXTSONG"];
              };
            },
            {
              direction: "None";
              mode: "OnRelease";
              action = {
                type: "Keypress";
                keys: ["KEY_PLAYPAUSE"];
              };
            }
          );
        };
      },
      {
    # Button behind the scroll
    cid: 0xc4;
    action =
    {
      type = "ToggleSmartshift";
    };
  }
    );
  }
);