Custom Floating Menu: Show on button-press and select item on button-release ("Super-mouse-gestures")

I activate my main Custom Floating Menu by pressing a dedicated mouse button, then making a standard left-click on the desired item.

It would be amazing to be able to have the Floating Menu show instantly on button-down (which it already does), but then to activate the desired item when releasing the mouse button over the item.

Not only would this make the normal operation of a mouse-button-activated menu much quicker and intuitive with less clicking, but at the same time it would be a new and very powerful way to use mouse gestures.

Others have requested an improvement of the gesture recognition system in the Mouse-Gestures capability of BTT which recognises curves but can't use simple straight-line gestures. From the replies on this I get the impression that this isn't something easily done and probably isn't coming soon.

Allowing the Custom Floating Menu to be used with the "mouse gestures method" of holding and releasing a mouse button would pretty much solve the problem of those who want an improved mouse-gestures system:

  1. Create a Floating Menu which has its placement centred on the mouse cursor upon activation.
  2. Set appropriate action buttons with positions as required (perhaps use large buttons to be easily hit with a "gesture")
  3. Set Floating Menu to "activate item upon Mouse-Up"

This can now be used in the same way as the user would classically use mouse gestures, but actually allows more flexibility, as it allows the popular straight-line gestures to be different lengths. For example, a short line will hit Item-A, while a longer line will go past Item-A and hit Item-B, it's totally up to the user as to where to place the buttons. The buttons/menu could be either transparent (like "real" gestures) or opaque if preferred.

All it would take would be to add the option to allow the menu item to be activated upon Mouse-Up, and it would instantly be a massively powerful alternative to using mouse gestures.


On further investigation, I've worked out how to do this, but with a workaround:

  1. Using USB Overdrive I changed the mouse button to the same mouse button but with a modifier key applied to it.

  2. Then in the Floating Menu settings in BTT, set the "Modifier based visibility" to only show the floating menu with the specified modifier held down.

  3. And also the "Trigger actions for hovered items on hide vide modifiers"

Now pressing the mouse button makes the menu appear, and the item is activated upon releasing the mouse button, so it can be used in the same way as mouse gestures (but better). This is amazingly useful. Thanks so much for the Floating Menus! (though it would be a really useful function to have built in if possible)

You should be able to do this in BTT also:

1.) Set up the same button twice in the "Normal Mouse" section. Make on of them trigger on "mouse down" and one on "mouse up".
2.) Assign the "Show Floating Menu" action to the "mouse down" one.
3.) Assign the "Trigger Hovered Menu Item" action followed by the "Hide Floating Menu Action" to the "mouse up" one

I haven't verfiied it yet because I currently don't have a mouse with me. But I think it should work:

Ah I see. I gave this a try but it didn't quite work for me.

It seems that it always just uses the mouse position at the point of the Mouse Down rather than the (different) position at the point of the Mouse Up, and therefore always triggers the same item at the centre (where the cursor started) rather than the item actually under the cursor. Not sure if this is expected/desired behaviour, or could be considered a slight bug.

But no big deal, the USB Overdrive method is working well.

Ah it's possible the hover position is not updated during mouse drags. I'll look into that.

1 Like

Should now be working in 4.213 alpha (currently building & uploading) using the "Trigger Hovered Item And Hide Floating Menu" action:

I've applied this update but it doesn't seem to have changed anything. I've tested making fresh Floating Menus and using different mouse buttons. It still only uses the initial cursor position instead of the position when releasing the button

weird, it seems to work correctly here. In your case it is not triggering the item which was hovered when the mouse-up happens?

It always just triggers the item which was under the mouse upon mouse-down, regardless of which other item the cursor is moved to before mouse-up.

A detail which might be a clue is that the "hover background color" of the item is not shown when the cursor moves while holding the mouse button down, so maybe the hover function itself isn't working for me while the mouse button is still held down(?)

Just to add a little more: The "Trigger Hovered Menu Item And Hide Floating Menu" action works by itself. I've tried assigning it as a key command to test, and then used it to do what it's supposed to do with an open floating menu, and it works fine.

But when it's working in that test, the "hover" function is clearly registering properly, as the item background colours change upon hovering.

This seems to be the issue with holding a mouse button down to make the floating menu appear. While the mouse button is held down which activates the floating menu, no hovering is registered, as no items change their background colour.

Could you try again with 4.214? I think it's maybe a timing issue.

I have now a pretty cool setup where a long right-click shows a floating menu that can be triggered like this, a short right-click shows the standard context menu. I'll make a tutorial on how to set this up once it is working reliably for you!

1 Like

That now seems to be working great. I've only given it a quick try but the items are activated perfectly upon mouse-up.

Thanks for dealing with this on a Sunday :pray:t2:

A slight bug I've come across when tinkering around with this today: I've got the floating menu set to be positioned at the mouse cursor. This works perfectly when it's activated by the action "Toggle floating menu hidden/shown", but when using the action "Show floating menu" it doesn't seem to work. It just shows the menu in a static position unaffected by the cursor position.

Thanks for reporting, that should now also work with 4.215!

Yeah that has fixed it (4.216)