Skip to content

Enabling two finger middle mouse drag blocks scale and rotate gestures #111

@osresearch

Description

@osresearch

I want to enable middle finger dragging with two fingers, but without tapping, in order to have very smooth camera orbiting in Blender. I can select this mode by running:

xinput set-prop 'Apple Inc. Magic Trackpad 2' 'Trackpad Scroll Settings' 150 0 500
xinput set-prop 'Apple Inc. Magic Trackpad 2' 'Trackpad Scroll Buttons' 2 2 2 2

However, this breaks the other two finger gestures. Scale and Rotate events are no longer generated, so zooming in and out with pinching the trackpad in Blender no longer works. Switching the Trackpad Scroll Buttons back to 4 5 6 7 and the scale and rotate events come back, but there are no button presses for the motion events when doing the two finger drag.

I think the issue is this special case in get_button_for_dir():

int get_button_for_dir(const struct MConfigSwipe* cfg_swipe, int dir){
        switch (dir){
        case TR_NONE:
                if(cfg_swipe->up_btn == cfg_swipe->lt_btn && cfg_swipe->lt_btn == cfg_swipe->dn_btn && cfg_swipe->dn_btn == cfg_swipe->rt_btn)
                        return cfg_swipe->up_btn;
                return -1;

Since a button is returned even when there is no motion, the trigger_swipe_unsafe() decides that it is a scroll event and starts processing it immediately.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions