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

OnFewPixels seems to only work once #29

Closed
muesli opened this issue Mar 18, 2020 · 7 comments
Closed

OnFewPixels seems to only work once #29

muesli opened this issue Mar 18, 2020 · 7 comments

Comments

@muesli
Copy link

muesli commented Mar 18, 2020

I'm trying to hook up my thumb button to react to directional moves while pressed, like in the example configuration. That works fine, but when I try to switch from OnRelease mode to OnFewPixels the action seems to only ever be triggered once, until the next restart of logid.

@PixlOne
Copy link
Owner

PixlOne commented Mar 18, 2020

That's weird, my MX Master doesn't seem to have that issue.

Could you post a log of the program and your config file?

@muesli
Copy link
Author

muesli commented Apr 1, 2020

Config:

devices: (
{
    name: "MX Master 3";
    smartshift:
    {
        on: true;
        threshold: 10;
    };
    hiresscroll:
    {
        hires: false;
        invert: false;
        target: false;
    };
    dpi: 1250;

    buttons: (
        {
            cid: 0xc3;
            action =
            {
                type: "Gestures";
                gestures: (
                    {
                        direction: "Up";
                        mode: "OnFewPixels";
                        action =
                        {
                            type: "Keypress";
                            keys: ["KEY_PAUSE"];
                        };
                    },
                    {
                        direction: "Down";
                        mode: "OnRelease";
                        action =
                        {
                            type: "Keypress";
                            keys: ["KEY_F12"];
                        };
                    },
                    {
                        direction: "None";
                        mode: "OnRelease";
                        action =
                        {
                            type: "Keypress";   
                            keys: ["KEY_LEFTCTRL", "KEY_LEFTALT", "KEY_TAB"];
                        };
                    }
                );
            };
        }
    );
}
);

KEY_PAUSE triggers my Terminal being focused on my system. When I hold the thumb button and move the mouse up the terminal quickly gains focus, then loses it again. It looks as if the event is triggered twice in very quick succession - and then never again. The other actions keep working.

PixlOne added a commit that referenced this issue Apr 1, 2020
@PixlOne
Copy link
Owner

PixlOne commented Apr 1, 2020

Your config file was missing a pixels field for OnFewPixels which resulted in undefined behaviour. It should have warned you about that and disabled the gesture but for some reason, it didn't.

I just fixed this in the latest commit.

@PixlOne PixlOne closed this as completed Apr 1, 2020
@muesli
Copy link
Author

muesli commented Apr 1, 2020

@PixlOne Oh, I see. Thank you! I also misunderstood the function: I thought it'd only trigger once (after a "few" pixels). Maybe such a "single-shot" method could be added as well?

@PixlOne
Copy link
Owner

PixlOne commented Apr 1, 2020

Yeah, I didn't really know what I should call it. In hindsight, I should have called it "PixelInterval". I might change it but I'd like to avoid messing with people's configs.

@muesli
Copy link
Author

muesli commented Apr 1, 2020

I agree, the config should probably remain compatible. We could either add a separate singleshot mode, or switch to that behavior in OnFewPixels mode when pixels is set to 0?

@muesli
Copy link
Author

muesli commented Apr 1, 2020

Also, maybe it would be a nice idea to add a OnFewPixels mode configuration to the example configuration file?

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

No branches or pull requests

2 participants