Floating Menu Alpha Development Thread

Feature request for:

  • Standard Item
  • Submenu
  • Back Button Item

Customize the trigger behaviour for each item, with the following options:

  • trigger action when clicking with left button/hitting Enter
  • trigger action if hovering the item

If user selects the hovering option, then user could configure how much time must be the mouse hovering the item to trigger the action.

I think it can be useful for navigating the submenus forward and back, avoiding click-click-click.

I think there isn't yet a way to show/hide Menu items based on the currently active app?
It would be great to be able to only show relevant buttons to the currently focused app, current time, ... and other variables.

Something like these trigger conditions that we have for other parts of BTT:

Yes, that's what I'm trying to do!
I want the shortcut to get the input and do something with it, in my case add it to a list.

@ocean-success Can't seem to get the input, IDK how to setup the Named trigger. And When I type and click enter, it doesn't trigger the shortcut with the input...

Also, did you find a way to clear the input field after triggering it ?

Do you mean named trigger like in the photo I shared? If so that named trigger is not needed at all, it’s just showing a confirmation HUD. Although I now see how that could be confusing as I’ve used the term “HUD” in multiple places.

As for clicking and pressing enter, they also don’t seem to work for me. What does work is the “Trigger Hovered Item When Menu Is Being Hidden” option, I’m using that on keyup. So keydown to show menu, hover over item/button with mouse, keyup to trigger item/button.

No, I haven’t found a way to clear the textfield, but I also haven’t tried…. seems doable though.

1 Like

Oh okay, thanks
So there's a problem in BTT then for click and Enter key.

I think there isn't yet a way to show/hide Menu items based on the currently active app ?

This should be possible using either the standard app list or conditional activation groups. The general logic is:
• Items defined for "All Apps", currently always show (I might add an option to prevent this).
• If you add a menu with the same identifier to another app or to a conditional activation group, the global items will be merged with the app specific / CAG specific ones.
• If multiple CAGs are active at the same time and contain menus with the same identifier, their items will be merged.
• You can exclude apps from CAGs

If you have a concrete example you'd like to implement, I can show you how to do that.

1 Like

Here is a simple example on how to trigger a shortcut when hitting enter in the textfield (and passing the textfield value as input). This makes use of the "run real javascript" action. You need to replace the values for shortcut, menu name and item name with the ones of your menu / the shortcut you want to trigger.

(async () => {
  let shortcut = "THE_NAME_OF_THE_SHORTCUT";
  let menuName = "THE_NAME_OF_THE_MENU";
  let itemName = "THE_NAME_OF_THE_TEXTFIELD_ITEM";

  let textFieldValue = await callBTT("get_menu_item_value", {
    menu_name: menuName,
    item_name: itemName,
  });

  let result = await runAppleShortcut({
    name: shortcut,
    input: textFieldValue,
  });

  returnToBTT(result);
})();

Never heard of conditional activation groups? Where can I find it ?

Yes, Basically, I made a floating menu activated with Shift+Ctrl
I'm using arc, it's easier for me to Show a menu, hover over the space I want and it switches, instead of ctrl+# (1,2,3,4,...)

Menu item 1 : ctrl+2
Menu item 2 : ctrl+3
Menu item 3 : ctrl+4

I use the floating menu for other things, so These 3 buttons for switching browser tabs should only be visible when the browser is active.

[been testing today with some scripts even if I'm on another app, activate the browser app first then Switch to the desired space, but it kept getting weird, creating new tabs...]

Used this Shell script:

#!/bin/bash

app_name="Arc"
osascript -e "tell application \"$app_name\" to activate"
sleep 1

Sometimes it works, sometimes it doesn't.

Menu (with trigger on hover & hide)

Action

Thanks @Andreas_Hegenberg !
Works perfectly.

image
(Looks like I can't edit the space between the SF Symbol and the text field)

For this you don't even need Conditional Activation Groups, you'd just add Arc to the left sidebar:

Then add a menu which has the same identifier/name as your existing one. BTT will then merge the buttons you define in Arc, with your main menu.

When merging the menus the order of their items might not be as you expect. In that case you might need to use the display order field to modify it:

Conditional Activation Groups are created like apps:

1 Like

Thanks!!
Never used CAG, but it's very useful !


Added a Keyboard Shortcut as an action.

But BTT sends
Ctrl+A instead of Ctrl+2
Ctrl+A instead of Ctrl+3
Ctrl+A instead of Ctrl+4

It was working fine before.

[Using the floating menu buttons to switch between Spaces on Arc Browser]

This one:

i don't think that's possible :slight_smile:

How did you check it's sending ctrl+a?

Using KeyCastr
image

That would be really weird. BTT uses the same transformation for showing the shortcut in the UI and for sending it - so I don't see any way how this could break (if the UI shows the correct shortcut).
Sounds stupid, but could you try to restart your machine?

Are you sure you are looking at the correct menu?

Restarted machine, Still the same problem :slight_smile:

BTT Prefs menu

Create a menubar icon and it works fine! sends the correct keyboard shortcut.
image
The Floating menu button sends Ctl+A

I activate the floating menu using Shift+Ctrl, I don't think that's the problem tho.
It was working fine before.

Is there a way to have a fade in/fade out animation on window hover resize? I'm thinking of testing some other options aside from the default animation since it's quite laggy because of the html/css responsive design resizes.

@Andreas_Hegenberg

Any solution to this? I still have the same problem since 2months ago :confused:

The "Auto Adapt to current keyboard layout" was the issue here :slight_smile:
I disabled it, and now it's working. :+1:

1 Like