I have a Floating Menu with a Web Item... I use this as sort of a notification, letting me know of some layers pressed on my keyboard. I don't need to interact with it. It seems like whenever I activate it, my cursor will loose focus... I notice this only when I'm on an input field.
It seems like my currently active app doesn't change, but the cursor stops blinking, so it's very inconvenient if I'm in the middle of typing something. Any way to avoid this? I don't know if I'm missing any toggle or option.
I did try with the Show HUD overlay, but I wanted more control on the font and size. Also, I need to be able to toggle it on/off as needed but the HUD overlay can only be triggered to appear and will fade out automatically (at least in my testing)
Somehow, in a recent version the Floating Menus (with a Web Item) are stealing focus once again. I'm on 5.447 and not exactly sure when it started happening. It's not sealing text input focus, it's just the window. You can even notice it on the items on the current window being greyed out (attaching a short sample).
It's disrupting some apps that depend on my focus being on them while opening these floating webviews through BTT.
I've narrowed the focus issue to version btt5.326-2025042003.zip ... the one before that doesn't have the problem. I hope this helps with the fix. I'm downgrading for now.
there has been a bugfix in that one which made the focus work if the focus checkboxes were ticked. Maybe you have it set to focus in your show floating menu action?
Hi there, old topic, but how can I give keyboard focus back to the active app/window once I clicked on the web view item (because when click on a web view item in floating menu, the current active app/window lost keyboard focus)
To be clear, my problem is I designed a menu in a webview and show it inside a floating menu. The problem is that when I click on a menu item, the called BTT action does nothing because the app has no more keyboard focus (I try to send a shortcut to the app)
That's exactly what I've tried : Saving current active window and app.
So when I click a web view button, I tried to activate back app/window before running BTT action, but it doesn't work. It is because the active app/window is still active (i.e. the red/orange/green circles are bright) BUT the app/window has no keyboard focus (this is the web view that has the keyboard focus)
I'm triggering BTT action in javascript this way below
Note that for the moment, the only workaround I found is to hide floating menu, run the BTT action, and show floating menu again. But it is awful the way it makes floating menu blinking
For information, I'm using a bluetooth numpad as a macro pad. The floating menu help me to remind me what key is assigned to with shortcut, and I also want to be able to click on floating menu button to run BTT action.
It looks like this :
I think the fix should be to have a function to give back an app/window the keyboard focus. I've looked if AppleScript could do that, but no luck, I didn't find a way.
One interesting thing : It seems that "standard items" behave differently, they don't steal keyboard focus of active app/window. This behavior is only concerning "web view items".
[EDIT and Fully replace my previous post with solution below]
Finally got it working, hooray !
Now, I found a way to play with a web view that can trigger BTT actions by clicking web UI buttons/elements
If anyone is interested, I can provide exemple files (html, javascript etc.) . I cannot export my preset because it now contains some sensitive data.
What I've learned
Executing "assigned actions for trigger" from web view doesn't work with code like execute_assigned_actions_for_trigger({uuid: '2F34005D-4537-464D-94E9-A7F42DA39DF1'}); I really don't know why, maybe a bug in BTT or it is because when I click on a web view button the web view steal the keyboard focus (or sort of, but it seems that MacOS is doing something)
All subsequent web view javascript code after a javascript call to an action that hide the floating menu will not be executed (or maybe the 1st one, but it is only because of speed of execution). After reflexion, it is obvious because the web view is closed, so the javascript runtime/execution can not continue. it should be documented somewhere I think
The web view doesn't really steal the keyboard focus when clicked, but some apps disable (i.e. gray out a part of UI and any BTT trigger doesn't work)
For example, with Mail app, when I click inside the web view, the navigation pane is greyed.
I want to turn a simple numpad to a macro pad. It seats on the left of my keyboard
Because I assign a lot of BTT triggers depending on the macOS app I'm working, I sometimes forget which numpad key does what
So the project is to display a floating window that represent the numpad with the current app shortcuts assign to each keys (I display Icons)
As I was working on this project, I found useful to also be able to click with mouse cursor directly on the numpad floating menu button (i.e. the web view) to execute the assigned BTT trigger. This was the most tricky part, because a simple call to javascript BTT function like execute_assigned_actions_for_trigger was doing nothing (i.e. correctly executed by BTT, but the macOS app did not respond/react)
The Resulting BTT floating menu with a "web view" item looks like this (example for Safari app shortcuts)
For those interested, I give the BTT preset. You should adapt it for your needs
I discovered that executing the BTT trigger assigned actions from a BTT "reusable trigger" worked. So I needed to setup all "numpad key press" execution in a BTT reusable trigger instead of in with javascript in the web view. The BTT reusable trigger look like this (most relevant parts are in red)
Set a bunch (3) BTT variables in web view with javascript (a trigger to execute this BTT "reusable trigger", the UUID of the BTT trigger containing actions that will be ran, a flag to tell if we need to hide/show floating menu to execute the BTT trigger)
To trigger this BTT trigger when a BTT variable changed. This variable change is done in the web view with javascript (I set it to 1 to trigger BTT)
The trigger assigned actions are executed with a "real javascript" BTT action in this trigger. It just use the trigger UUID passed by the web view into a BTT variable to know what BTT trigger UUID assigned actions to run