MacGesture/MacGesture

Feature req: Timeout gesture for default action

kn666 opened this issue · 6 comments

kn666 commented

Sometimes the default behavior of the right button is required. If you right-click and wait longer than the threshold value without moving (for example, 0.5 s), the gesture can be canceled and default events can be triggered. Thanks.

kn666 commented
  1. Also if gesture is shorter than some minimum (5-10px) cancel it and fire default click event.

There certainly is a default action 🤔 and it works exactly as you describe; if you don't move the mouse at all, after a short timeout, right click is invoked; at least in case of click quick.

The minimum pixel length rule is also applied already. 👍

Is there some specific application causing you troubles? It could also be caused by your gestures configuration, yet I can't really think about a possible setup in real quick. Or do you specifically mean click-and-hold action? 💡

kn666 commented

For example, in Desktop (Finder) even after shortest movement menu will not be opened.
Similarly even if I wait for several seconds, gesture will not timeout. This is disturbing in RDP window, where I need interaction with MS Windows for right button file drag-drop.

What are timeout and minimal length values? Is it possible to expose them for fine tuning?

Uff, I haven't looked at the code for some time 😄 yet it should be as follows:

  • minimal gesture length value (threshold) seems to be 30 screen points (AppDelegate.m:382)
    • I've just tested – short gestures are ignored and invoke context menu immediately, it behaves this way (to my surprise) in all 360° directions
  • timeout after quick mouse click release is pretty short, yet still capable of performing the gesture when it's indicated
    • there's no actual value here I guess as it's only limited by the interruption MacGesture causes in the event loop, tries to identify the gesture and hands the event resolution back to the system in case no gesture is recognised

If you press the right-button, keep it pressed and release after some time, then no, there's no timeout in that case (as during the press, we expect user to perform a gesture) and after releasing, context menu is shown until manually dismissed. If you want the context menu to be shown, you're supposed to either a) release the right mouse button at some point or b) release it immediately so that MG wouldn't even start recognising the gesture.

Behaviour in combination with any RDP/remote desktop software may cause issues as these apps have their own mouse capture & events processing stacks, very likely in conflict with what MG may do. Windows-specific gestures like right-mouse dragging are even not known to macOS and since MG wants to follow macOS behaviour guidelines in the first place, this would be a direct conflict. I'd better recommend blacklisting RDP apps as we can't really guarantee any good behaviour with these.

kn666 commented
  1. Could you please expose 30 in settings to play with it? I have a HiDPI screen, and maybe 30 is not enough for me.
  2. If I
  • press the right button, wait 3 sec, draw a gesture, release the right button
  • or press the right button, draw a gesture, wait 3 sec, release the right button
    in both cases, the gesture is fired. Is it different for you?

I'd prefer to have the standard action if the gesture took longer than {parameter} seconds.

kn666 commented

I've additionally checked 1. Short gesture is actually not triggered. But default action - like local menu for desktop is also not invoked for me.