MacGesture/MacGesture

Unable to recognize consecutive mouse wheel inputs

Swaggarwal opened this issue ยท 5 comments

๐Ÿ‡ฌ๐Ÿ‡ง Please write the feedback in English if possible so everyone who might read it will be able to respond easily! ๐Ÿ‘

Describe the bug
As the title states, MacGesture does not recognize multiple mouse wheel inputs within a single gesture. I am attempting to implement the example gestures included in the readme that involve use of the mouse scroll wheel for changing tabs.

Steps To Reproduce
MacGesture 3.0 on Mac OS X 11.2.3 with a Logitech MX Master 3. See below for my MacGesture setup.
image

Expected behaviour
As expected, when I hold down the right button and scroll up/down, the shortcut activates a single time. However, if I keep the right mouse button held and continue to scroll, no further shortcuts are activated. It does not matter whether I scroll in different directions or move the mouse around. To re-trigger the shortcut, I need to release the right mouse button and repeat the gesture. I am unable to move more than 1 tab in a single gesture (i.e. in a single click of the right mouse button).

Desktop (please complete the following information):

  • OS: Mac OS X 11.2.3
  • Browser: tested in Safari and Chrome
  • Version: MacGesture 3.0
  • Mouse: Logitech MX Master 3

Additional context
It appears that within a single gesture the mouse scroll is only ever recognized once. If I move the mouse in different directions and continue scrolling, no further mouse scroll actions are registered. I believe this to be the root source of the problem, as if I reprogram the gesture to re-trigger off a mouse movement instead of scroll (see the last gesture in the above screenshot, programmed as U*R instead of U*u) the gesture works as intended. However, this is not ideal since to register multiple mouse movements in the same direction the mouse must be moved in a different direction in between each trigger.

qpcio commented

I have exactly same issue - there is only one scroll wheel action (either up or down) that is being registered in single gesture chain. No matter what I do between those scrolls and which directions they are in - always only one registered. And I would really love to see that example working! You made me really thrilled to have that!

I meet the same problem

I found the reason why:

we have a code to determine the direction of wheel:

 double delta = CGEventGetDoubleValueField(event, kCGScrollWheelEventDeltaAxis1);

image

but when we run cmd+shift+[ on the first dispatch, then Whether we scroll up or down, we will get delta is 0,

image

it seem that when we press shift, the wheel will became horizonal scroll

And now I think I found a solution for this problem:

https://stackoverflow.com/questions/2008126/cgeventpost-possible-bug-when-simulating-keyboard-events

I will send a pull request later