# Floating menus to behave like a normal window + few other observations

**URL:** <https://community.folivora.ai/t/floating-menus-to-behave-like-a-normal-window-few-other-observations/42765>\
**Category:** Bugs or Unexpected Behavior\
**Tags:** floating-menu\
**Created:** [March 11, 2025, 10:27am UTC](https://community.folivora.ai/t/floating-menus-to-behave-like-a-normal-window-few-other-observations/42765 "2025-03-11T10:27:19Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![xidiot](https://community.folivora.ai/user_avatar/community.folivora.ai/xidiot/32/27204_2.png) [@xidiot](https://community.folivora.ai/u/xidiot)\
**Post date:** [March 11, 2025, 10:27am UTC](https://community.folivora.ai/t/floating-menus-to-behave-like-a-normal-window-few-other-observations/42765/1 "2025-03-11T10:27:19Z")

</div>

1. I've tried to migrate a "floating webview" to a floating menu with "Web Item", however it seems it cannot behave like a normal window - at the moment I'm looking for a way to be able to move the window (the floating menu) to the next monitor, using the shortcut I'm using for all other windows + the "floating webview" but this doesn't work. The floating menu is configured with window level "Like A Normal Window (0)".

2. If the window level is "Like A Normal Window (0)" the floating menu is opened, but behind the currently focused one. Is this expected?

3. In my html I have the following function:

```auto
	    // Function to detect Enter key and copy the value
	    function handleKeyPress(event) {
	        if (event.key === "Enter" && matchedAccountIdElement) {
	            copyToClipboard(); // Copy the value and close the window
	        }
	    }

```

Which is working only partially - the copy is working, but not the close. I've tried "Close After Button Press" but it seems to not have effect. This is working great with the "floating webview".

1. If I choose the floating menu to have a "standard title bar", it looks like that between the titlebar and the menu item, there's a space which is either transparent or the titlebar is not right next to the menu item, basically it seems that they are two separate UI elements (I guess they might be, but should not look like this). In the below screenshot you can see that that a part of the BTT icons can be seen:

 ![image](https://community.folivora.ai/uploads/default/original/3X/4/d/4d8ef881e8013a107243cd48bacaee72bd785a6c.png)

I can use "Title Bar Overlaying Content" to ...workaround this, but in that case there's no actual titlebar which I can grab and move with the mouse if needed.

When using "floating webview", the window is ... whole:  
 ![image](https://community.folivora.ai/uploads/default/optimized/3X/7/9/79f1c502a6f3dce7c719355b81d523e8c5dc7e55_2_690x40.png)

Here's the floating menu:  
[accounts\_floating\_menu.bttpreset](https://community.folivora.ai/uploads/short-url/oxk3Cgdu2D9gB2yoji4RwLQeXRG.bttpreset) (6.4 KB)

I've removed "BTTFloatingMenuRenderedPreview", hope it is not necessary.

---

<div class="post-metadata">

**Author:** ![Andreas\_Hegenberg](https://community.folivora.ai/user_avatar/community.folivora.ai/andreas_hegenberg/32/39221_2.png) [@Andreas\_Hegenberg](https://community.folivora.ai/u/Andreas_Hegenberg)\
**Post date:** [March 11, 2025, 10:45am UTC](https://community.folivora.ai/t/floating-menus-to-behave-like-a-normal-window-few-other-observations/42765/2 "2025-03-11T10:45:56Z")

</div>

You can improve the layout by disabling spacing & round corners:  
[titlebar.bttpreset](https://community.folivora.ai/uploads/short-url/lKRJtoSkHdLT2IhCqgxcnTNiZgl.bttpreset) (22.8 KB)

In 5.264 I slightly changed the "Show Floating Menu" action so it activates the BTT process if "Activate Keyboard Focus When Showing" is checked - this should make sure that window level 0 windows are brought to front.

 ![image](https://community.folivora.ai/uploads/default/original/3X/8/f/8f4bc4e47c1fba873b16717db3734fa3be13153d.jpeg)

To close the floating menu via Java Script you could use

```auto
let result = await trigger_action({json: JSON.stringify({
  BTTPredefinedActionType: 387,
  BTTPredefinedActionName: 'Hide Floating Menu',
  BTTAdditionalActionData: '{\"BTTMenuActionMenuID\":\"accounts\"}',
}), wait_for_reply: true});

```

---

<div class="post-metadata">

**Author:** ![xidiot](https://community.folivora.ai/user_avatar/community.folivora.ai/xidiot/32/27204_2.png) [@xidiot](https://community.folivora.ai/u/xidiot)\
**Post date:** [March 11, 2025, 11:10am UTC](https://community.folivora.ai/t/floating-menus-to-behave-like-a-normal-window-few-other-observations/42765/3 "2025-03-11T11:10:12Z")

</div>

Yep, now the floating menu is shown infront of the focused one, but still cannot be moved using a shortcut.

Thank you for the spacing, I've played with it, but maybe I've missed something.

I'm not sure about the Java Script - how should I use it? The function I've pasted above is in my HTML file. My use-case is: once the floating webview is shown, I have a search field in it which will upon search will match and select a text from it, which on enter copies it and closes the floating webview

---

<div class="post-metadata">

**Author:** ![Andreas\_Hegenberg](https://community.folivora.ai/user_avatar/community.folivora.ai/andreas_hegenberg/32/39221_2.png) [@Andreas\_Hegenberg](https://community.folivora.ai/u/Andreas_Hegenberg)\
**Post date:** [March 11, 2025, 11:16am UTC](https://community.folivora.ai/t/floating-menus-to-behave-like-a-normal-window-few-other-observations/42765/4 "2025-03-11T11:16:46Z")

</div>

you could add the script after the "copyToClipboard()" call.

Moving the window via the standard actions doesn't work because floating menus in general exclude themselves from macOS Accessibility (this is important for menus that don't behave like normal windows). However maybe I can change this for the "floating menu with titlebar" usecase.

//edit, 5.265 should not exclude menus from Accessibility if they have a standard titlebar

---

<div class="post-metadata">

**Author:** ![xidiot](https://community.folivora.ai/user_avatar/community.folivora.ai/xidiot/32/27204_2.png) [@xidiot](https://community.folivora.ai/u/xidiot)\
**Post date:** [March 11, 2025, 12:10pm UTC](https://community.folivora.ai/t/floating-menus-to-behave-like-a-normal-window-few-other-observations/42765/5 "2025-03-11T12:10:35Z")

</div>

With 5.265 there's not need of the JS and the shortcut works. Thank you!

One more thing - when "floating webview" is toggled, the initial state is shown, and with the floating menu, the last state (after a search) is shown. "Keep menu in cache" is not enabled.

---

<div class="post-metadata">

**Author:** ![xidiot](https://community.folivora.ai/user_avatar/community.folivora.ai/xidiot/32/27204_2.png) [@xidiot](https://community.folivora.ai/u/xidiot)\
**Post date:** [May 21, 2025, 3:19pm UTC](https://community.folivora.ai/t/floating-menus-to-behave-like-a-normal-window-few-other-observations/42765/6 "2025-05-21T15:19:31Z")

</div>

Hey @Andreas_Hegenberg , I'm trying to create a floating menu with a single textfield item. I want the text field to be focused/to steal the keyboard when the menu is activated, but this is not happening. I've tried the "Steal Keyboard Focus On Show" in the menu's setup and also the "Activate Window & Steal Keyboard Focus" in the action's configuration, but still the text field is not stealing the keyboard. Am I missing something?

I've just restarted BTT and upon the initial show the field is focused, but if I toggle it the field is no longer in focus.

Also is there a way to clear the text field on toggle?

---

<div class="post-metadata">

**Author:** ![Andreas\_Hegenberg](https://community.folivora.ai/user_avatar/community.folivora.ai/andreas_hegenberg/32/39221_2.png) [@Andreas\_Hegenberg](https://community.folivora.ai/u/Andreas_Hegenberg)\
**Post date:** [May 21, 2025, 4:01pm UTC](https://community.folivora.ai/t/floating-menus-to-behave-like-a-normal-window-few-other-observations/42765/7 "2025-05-21T16:01:36Z")

</div>

There was indeed no good way to focus standard text items.

Could you check whether it works with 5.412 alpha when using the show floating menu action like this and checking the "Has Initial Focus" option for the text field item?

 ![image](https://community.folivora.ai/uploads/default/original/3X/f/2/f2d3282da457d8bda9b2290f903a9073a039e3b7.jpeg)  
 ![image](https://community.folivora.ai/uploads/default/original/3X/7/c/7c705a77c21d46d34470a18efa82af33a374234c.jpeg)

---

<div class="post-metadata">

**Author:** ![xidiot](https://community.folivora.ai/user_avatar/community.folivora.ai/xidiot/32/27204_2.png) [@xidiot](https://community.folivora.ai/u/xidiot)\
**Post date:** [May 21, 2025, 4:10pm UTC](https://community.folivora.ai/t/floating-menus-to-behave-like-a-normal-window-few-other-observations/42765/8 "2025-05-21T16:10:01Z")

</div>

Yep, this solves it. Thank you!

---

<div class="post-metadata">

**Author:** ![xidiot](https://community.folivora.ai/user_avatar/community.folivora.ai/xidiot/32/27204_2.png) [@xidiot](https://community.folivora.ai/u/xidiot)\
**Post date:** [May 21, 2025, 10:06pm UTC](https://community.folivora.ai/t/floating-menus-to-behave-like-a-normal-window-few-other-observations/42765/9 "2025-05-21T22:06:34Z")

</div>

> [@Andreas\_Hegenberg](#):
>
> In 5.264 I slightly changed the "Show Floating Menu" action so it activates the BTT process if "Activate Keyboard Focus When Showing" is checked - this should make sure that window level 0 windows are brought to front.

The below is related to the initial floating menu which I've migrated from a "floating webview", and not to the menu with a textitem from my last comment.

Basically issue is like point 2 in the 1st comment, but it is "fixed" with a toggle:

It seems that if the window level == 0, the initial show of the menu is happening, however the window/floating menu is behind the currently active window. This stop happening after 1 or 2 more menu toggles. If the windows level is higher - no such issue, but the text field (configured inside HTML file) is not focused.

---

<div class="post-metadata">

**Author:** ![Andreas\_Hegenberg](https://community.folivora.ai/user_avatar/community.folivora.ai/andreas_hegenberg/32/39221_2.png) [@Andreas\_Hegenberg](https://community.folivora.ai/u/Andreas_Hegenberg)\
**Post date:** [May 21, 2025, 10:09pm UTC](https://community.folivora.ai/t/floating-menus-to-behave-like-a-normal-window-few-other-observations/42765/10 "2025-05-21T22:09:09Z")

</div>

weird, the show action is set to "activate window & steal keyboard focus"?

---

<div class="post-metadata">

**Author:** ![xidiot](https://community.folivora.ai/user_avatar/community.folivora.ai/xidiot/32/27204_2.png) [@xidiot](https://community.folivora.ai/u/xidiot)\
**Post date:** [May 21, 2025, 10:10pm UTC](https://community.folivora.ai/t/floating-menus-to-behave-like-a-normal-window-few-other-observations/42765/11 "2025-05-21T22:10:18Z")

</div>

Yep. Upon toggle few times, menu is being brought to front on and focus + keyboard are stolen.

---

<div class="post-metadata">

**Author:** ![Andreas\_Hegenberg](https://community.folivora.ai/user_avatar/community.folivora.ai/andreas_hegenberg/32/39221_2.png) [@Andreas\_Hegenberg](https://community.folivora.ai/u/Andreas_Hegenberg)\
**Post date:** [May 21, 2025, 10:13pm UTC](https://community.folivora.ai/t/floating-menus-to-behave-like-a-normal-window-few-other-observations/42765/12 "2025-05-21T22:13:09Z")

</div>

do you have the autofocus text field option enabled on the webview item?

 ![image](https://community.folivora.ai/uploads/default/original/3X/1/5/15333f466bf2f81b49f6e2a1f67255246abf1252.jpeg)

---

<div class="post-metadata">

**Author:** ![xidiot](https://community.folivora.ai/user_avatar/community.folivora.ai/xidiot/32/27204_2.png) [@xidiot](https://community.folivora.ai/u/xidiot)\
**Post date:** [May 22, 2025, 9:38pm UTC](https://community.folivora.ai/t/floating-menus-to-behave-like-a-normal-window-few-other-observations/42765/13 "2025-05-22T21:38:40Z")

</div>

Yes. In the html file I have the following as well:

```auto
	<input type="text" id="searchInput" placeholder="Search for account names..." onkeyup="searchFunction()" autofocus>

```

```auto
		// Automatically focus the search input when the page loads and add keypress event listener
		window.onload = function () {
			var searchInput = document.getElementById("searchInput");
			searchInput.focus();
			searchInput.addEventListener("keyup", handleKeyPress); // Listen for "Enter" key press
		};

```

---

<div class="post-metadata">

**Author:** ![xidiot](https://community.folivora.ai/user_avatar/community.folivora.ai/xidiot/32/27204_2.png) [@xidiot](https://community.folivora.ai/u/xidiot)\
**Post date:** [June 5, 2025, 6:58am UTC](https://community.folivora.ai/t/floating-menus-to-behave-like-a-normal-window-few-other-observations/42765/14 "2025-06-05T06:58:50Z")

</div>

Andreas, I see other people are reporting similar issues in the past few days. Are we missing something?

I'll summarize:

- **If Window level == 0** - menu is shown, but is **not** on focus, and it is behind the currently active one.

- **If Window level \> 0** - menu is shown in front, however I think it is **not** on focus, because the [dim floating menu](https://community.folivora.ai/t/dim-inactive-windows/43764/2) is not shown behind the webview item, only after a toggle, of the webview, text field is focused + the dim floating menu is shown. I have "Steal Keyboard Focus On Show" + the html config for stealing focus + "Autofocus Text Field"

---

<div class="post-metadata">

**Author:** ![Andreas\_Hegenberg](https://community.folivora.ai/user_avatar/community.folivora.ai/andreas_hegenberg/32/39221_2.png) [@Andreas\_Hegenberg](https://community.folivora.ai/u/Andreas_Hegenberg)\
**Post date:** [June 5, 2025, 7:07am UTC](https://community.folivora.ai/t/floating-menus-to-behave-like-a-normal-window-few-other-observations/42765/15 "2025-06-05T07:07:13Z")

</div>

I think I have an idea what could influence this on some systems, I'll release an alpha later which checks some conditions and applies a workaround if necessary.

Could you check whether a floating menu **without** webview, focuses correctly?

---

<div class="post-metadata">

**Author:** ![xidiot](https://community.folivora.ai/user_avatar/community.folivora.ai/xidiot/32/27204_2.png) [@xidiot](https://community.folivora.ai/u/xidiot)\
**Post date:** [June 5, 2025, 7:37am UTC](https://community.folivora.ai/t/floating-menus-to-behave-like-a-normal-window-few-other-observations/42765/16 "2025-06-05T07:37:59Z")

</div>

I have a floating menu with some buttons (standard items):

- **If Window level == 0** - menu is shown, but is **not** on focus, and it is behind the currently active one.

- **If Window level \> 0** - menu is shown in front and I think it is on focus since I can click any item right away

---

<div class="post-metadata">

**Author:** ![Andreas\_Hegenberg](https://community.folivora.ai/user_avatar/community.folivora.ai/andreas_hegenberg/32/39221_2.png) [@Andreas\_Hegenberg](https://community.folivora.ai/u/Andreas_Hegenberg)\
**Post date:** [June 5, 2025, 9:15am UTC](https://community.folivora.ai/t/floating-menus-to-behave-like-a-normal-window-few-other-observations/42765/17 "2025-06-05T09:15:53Z")

</div>

For window level 0 it would be important to select the "Activate Window & Steal Keyboard Focus" option, because otherwise it might have keyboard focus but still be in the background

 ![image](https://community.folivora.ai/uploads/default/original/3X/6/7/6753662e155faa7a8d1fc57e42814a7562ce8ccb.jpeg)

---

<div class="post-metadata">

**Author:** ![xidiot](https://community.folivora.ai/user_avatar/community.folivora.ai/xidiot/32/27204_2.png) [@xidiot](https://community.folivora.ai/u/xidiot)\
**Post date:** [June 5, 2025, 9:54am UTC](https://community.folivora.ai/t/floating-menus-to-behave-like-a-normal-window-few-other-observations/42765/18 "2025-06-05T09:54:42Z")

</div>

Yep, even with "Activate Window & Steal Keyboard Focus" the menu is shown behind the active app. Here's the trigger:

```auto
[
  {
    "BTTActionCategory" : 0,
    "BTTLastUpdatedAt" : 1748026850.114186,
    "BTTTriggerType" : 136,
    "BTTTriggerTypeDescriptionReadOnly" : "TipTap Left (3 Fingers Fix)",
    "BTTTriggerTypeDescription" : "Show circular floating menu",
    "BTTTriggerClass" : "BTTTriggerTypeTouchpadAll",
    "BTTUUID" : "B8316AE7-A290-4552-A3D1-10074E7BB7AF",
    "BTTPredefinedActionType" : 366,
    "BTTPredefinedActionName" : "Empty Placeholder",
    "BTTNotesInsteadOfDescription" : 1,
    "BTTEnabled" : 1,
    "BTTEnabled2" : 1,
    "BTTRequiredModifierKeys" : 0,
    "BTTOrder" : 7,
    "BTTAdditionalActions" : [
      {
        "BTTActionCategory" : 0,
        "BTTLastUpdatedAt" : 1749116794.208982,
        "BTTTriggerParentUUID" : "B8316AE7-A290-4552-A3D1-10074E7BB7AF",
        "BTTIsPureAction" : true,
        "BTTTriggerClass" : "BTTTriggerTypeTouchpadAll",
        "BTTUUID" : "C1045A88-961C-4D42-837F-448A94524900",
        "BTTPredefinedActionType" : 386,
        "BTTPredefinedActionName" : "Show Floating Menu",
        "BTTAdditionalActionData" : {
          "BTTMenuActionActivateKeyboardFocus" : 1,
          "BTTMenuActionRestorePosition" : true,
          "BTTMenuActionMenuID" : "Rory"
        },
        "BTTEnabled" : 1,
        "BTTEnabled2" : 1,
        "BTTOrder" : 1
      }
    ],
    "BTTGestureNotes" : "Show circular floating menu",
    "BTTTriggerConfig" : {
      "BTTNoTouchTimeout" : 0
    }
  }
]

```

And here's the floating menu:  
[rory.bttpreset](https://community.folivora.ai/uploads/short-url/38vKvazRyGgfmaj6okskMauBPZB.bttpreset) (371.0 KB)

---

<div class="post-metadata">

**Author:** ![Andreas\_Hegenberg](https://community.folivora.ai/user_avatar/community.folivora.ai/andreas_hegenberg/32/39221_2.png) [@Andreas\_Hegenberg](https://community.folivora.ai/u/Andreas_Hegenberg)\
**Post date:** [June 5, 2025, 10:21am UTC](https://community.folivora.ai/t/floating-menus-to-behave-like-a-normal-window-few-other-observations/42765/19 "2025-06-05T10:21:18Z")

</div>

weird,  
your menu seems to be brought to front correctly here, is this happening (the showing behind some other window) with a specific app?

---

<div class="post-metadata">

**Author:** ![xidiot](https://community.folivora.ai/user_avatar/community.folivora.ai/xidiot/32/27204_2.png) [@xidiot](https://community.folivora.ai/u/xidiot)\
**Post date:** [June 5, 2025, 10:54am UTC](https://community.folivora.ai/t/floating-menus-to-behave-like-a-normal-window-few-other-observations/42765/20 "2025-06-05T10:54:54Z")

</div>

Nope, no matter which app is focused the menu is always shown behind. I've tried with WezTerm, ScriptEditor, MS Edge. Upon toggle menu is bring in front, and this happens only **if Window level == 0**

[Next page](https://community.folivora.ai/t/floating-menus-to-behave-like-a-normal-window-few-other-observations/42765.md?page=2)
