# Adding cursor support to the mini menu extension!

**URL:** https://forum.makecode.com/t/adding-cursor-support-to-the-mini-menu-extension/34903
**Category:** Arcade
**Tags:** extension
**Created:** [March 26, 2025, 4:20am UTC](https://forum.makecode.com/t/adding-cursor-support-to-the-mini-menu-extension/34903 "2025-03-26T04:20:54Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![WoofWoof](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/woofwoof/32/32523_2.png) [@WoofWoof](https://forum.makecode.com/u/WoofWoof)
#### Post date: [March 26, 2025, 4:20am UTC](https://forum.makecode.com/t/adding-cursor-support-to-the-mini-menu-extension/34903/1 "2025-03-26T04:20:54Z")

</div>

`WoofWoofCodes/pxt-mini-menu-cursor`

This is an extension that adds functionality for mini menu cursor support! It’s an add-on for @richards `Riknoll/arcade-mini-menu` extension, and uses the new Browser Events extension to let you to move and scroll menus with your cursor!

> **[mini menu cursor extension demo!](https://arcade.makecode.com/S28788-20655-72790-63970)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

All 6 added blocks can be found at the bottom of the Mini Menu tab, and can be combined with the Browser Events blocks to control menus with your cursor!

 ![Image 3-25-25 at 7.10 PM](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/f/7/f795df0db50688ab86a5857765a876e6cc919ca8.jpeg)

Here’s how I have used them inside the demo project:

 ![Screenshot 2025-03-25 at 7.09.24 PM](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/3/a/3ac21d533ca2dee4077f836eb7da1d3daffff449.png)

> **“all menus” and “simulate click” blocks:**
>
> The 2 unused blocks, “(all menus)” and “[simulate click of button]” are blocks I felt went well the extension. “(all menus)” is an array of all menu sprites, regardless of which “sprite type” they are, and the “simulate click” block lets you “click” a button using code, without actually having to click said button, which is how I’m triggering the “(myMenu) on [A] button pressed with (selection) (selectedIndex)” blocks in the menus!

Make sure to set “button events enabled” to false on menus you don’t want clicked, because all menus will all have their “button pressed” when you click one menu. That’s just something I didn’t find a way around.

When you add the extension, both Browser Events and Mini Menu will be automatically added if they aren’t already in your project, which is very convenient!

---

<div class="post-metadata">

### Author: ![Josef](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/josef/32/12457_2.png) [@Josef](https://forum.makecode.com/u/Josef)
#### Post date: [March 26, 2025, 5:00pm UTC](https://forum.makecode.com/t/adding-cursor-support-to-the-mini-menu-extension/34903/2 "2025-03-26T17:00:22Z")

</div>

Yay

---

<div class="post-metadata">

### Author: ![BotWarrior](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/botwarrior/32/25328_2.png) [@BotWarrior](https://forum.makecode.com/u/BotWarrior)
#### Post date: [March 26, 2025, 8:42pm UTC](https://forum.makecode.com/t/adding-cursor-support-to-the-mini-menu-extension/34903/3 "2025-03-26T20:42:54Z")

</div>

This is perfect thank you!

---

<div class="post-metadata">

### Author: ![AgentBoom](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/agentboom/32/16635_2.png) [@AgentBoom](https://forum.makecode.com/u/AgentBoom)
#### Post date: [March 26, 2025, 8:43pm UTC](https://forum.makecode.com/t/adding-cursor-support-to-the-mini-menu-extension/34903/4 "2025-03-26T20:43:23Z")

</div>

Awesome!

---

<div class="post-metadata">

### Author: ![CodeOnTheCob](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/codeonthecob/32/19306_2.png) [@CodeOnTheCob](https://forum.makecode.com/u/CodeOnTheCob)
#### Post date: [March 26, 2025, 8:47pm UTC](https://forum.makecode.com/t/adding-cursor-support-to-the-mini-menu-extension/34903/5 "2025-03-26T20:47:47Z")

</div>

w0w cool

---

<div class="post-metadata">

### Author: ![WoofWoof](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/woofwoof/32/32523_2.png) [@WoofWoof](https://forum.makecode.com/u/WoofWoof)
#### Post date: [March 28, 2025, 11:02pm UTC](https://forum.makecode.com/t/adding-cursor-support-to-the-mini-menu-extension/34903/6 "2025-03-28T23:02:57Z")

</div>

I just realized that this breaks if you add images to the menu items! I completely forgot about that feature of mini menus, and I will fix that soon!

---

<div class="post-metadata">

### Author: ![richard](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/richard/32/5417_2.png) [@richard](https://forum.makecode.com/u/richard)
#### Post date: [March 28, 2025, 11:07pm UTC](https://forum.makecode.com/t/adding-cursor-support-to-the-mini-menu-extension/34903/7 "2025-03-28T23:07:42Z")

</div>

@WoofWoof FYI, the reason that two fingered clicks on mac trackpads is wheel click right now is because I made a mistake in the extension! the hotfix we’ll be releasing soon for arcade will correct that.

---

<div class="post-metadata">

### Author: ![Josef](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/josef/32/12457_2.png) [@Josef](https://forum.makecode.com/u/Josef)
#### Post date: [March 29, 2025, 12:48am UTC](https://forum.makecode.com/t/adding-cursor-support-to-the-mini-menu-extension/34903/8 "2025-03-29T00:48:17Z")

</div>

Also please add constants as a block Tq Tq

---

<div class="post-metadata">

### Author: ![BotWarrior](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/botwarrior/32/25328_2.png) [@BotWarrior](https://forum.makecode.com/u/BotWarrior)
#### Post date: [March 29, 2025, 12:49am UTC](https://forum.makecode.com/t/adding-cursor-support-to-the-mini-menu-extension/34903/9 "2025-03-29T00:49:27Z")

</div>

Ah that makes sense

---

<div class="post-metadata">

### Author: ![WoofWoof](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/woofwoof/32/32523_2.png) [@WoofWoof](https://forum.makecode.com/u/WoofWoof)
#### Post date: [March 30, 2025, 1:27am UTC](https://forum.makecode.com/t/adding-cursor-support-to-the-mini-menu-extension/34903/10 "2025-03-30T01:27:00Z")

</div>

The extension has been updated! This is a major update, with block changes, so idk what will happen when you update the extension in existing projects.

Changes:

- added image support! Instead of a single set size for each menu item, the size of every individual menu item is grabbed, so the menu works correctly regardless of the size of each individual menu item. This means this will also work if you change menu item sizes some other way, such as changing the default font of the extension, which looks like it would be pretty simple to do with a simple edit to the extension… maybe a future project?
- I figured out how to “click” the menus without clicking the button for everything in your game, which I didn’t do before because… idk why, I didn’t even look into it before, so that’s on me I guess. Now you can simulate a click for all menus touching the cursor without clicking everything. I left the old “simulate click of button…” function in just because there isn’t any real reason to remove it.
- The “scroll menu” blocks have been consolidated into a single block with an up/down dropdown menu.
- Added a block for simulating a button click in a specified menu.
- Fixed some features like scrolling up/down by moving the cursor above/under the menu.

---

<div class="post-metadata">

### Author: ![WoofWoof](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/woofwoof/32/32523_2.png) [@WoofWoof](https://forum.makecode.com/u/WoofWoof)
#### Post date: [April 2, 2025, 9:32pm UTC](https://forum.makecode.com/t/adding-cursor-support-to-the-mini-menu-extension/34903/11 "2025-04-02T21:32:22Z")

</div>

Tiny edit to stop the click function from instantly clicking new menus that get created while the function is running. Basically if you have a new menu appear when you click a menu option, this change prevents that new menu from getting clicked.

---

<div class="post-metadata">

### Author: ![WoofWoof](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/woofwoof/32/32523_2.png) [@WoofWoof](https://forum.makecode.com/u/WoofWoof)
#### Post date: [April 3, 2025, 11:43am UTC](https://forum.makecode.com/t/adding-cursor-support-to-the-mini-menu-extension/34903/12 "2025-04-03T11:43:09Z")

</div>

Ok! These are famous last words, but I believe I have the extension all done! I just updated it so that it can detect whether or not a menu is “relative to camera” and adjust the cursor position accordingly. I think that was the last thing… I hope that was the last thing!! 😅  
If you find something wrong or that you want changed, just ask!

---

<div class="post-metadata">

### Author: ![Justasmallcoder](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/justasmallcoder/32/24428_2.png) [@Justasmallcoder](https://forum.makecode.com/u/Justasmallcoder)
#### Post date: [April 3, 2025, 6:38pm UTC](https://forum.makecode.com/t/adding-cursor-support-to-the-mini-menu-extension/34903/13 "2025-04-03T18:38:36Z")

</div>

🤯 THANK YOU!!!

---

<div class="post-metadata">

### Author: ![Stickman4269](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/stickman4269/32/23582_2.png) [@Stickman4269](https://forum.makecode.com/u/Stickman4269)
#### Post date: [April 8, 2025, 1:15pm UTC](https://forum.makecode.com/t/adding-cursor-support-to-the-mini-menu-extension/34903/14 "2025-04-08T13:15:26Z")

</div>

This extension conflicts with the tile-util extension. Is there any way to fix this?

---

<div class="post-metadata">

### Author: ![WoofWoof](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/woofwoof/32/32523_2.png) [@WoofWoof](https://forum.makecode.com/u/WoofWoof)
#### Post date: [April 8, 2025, 11:10pm UTC](https://forum.makecode.com/t/adding-cursor-support-to-the-mini-menu-extension/34903/15 "2025-04-08T23:10:18Z")

</div>

It seems to work fine for me. I don’t see any conflicts, and all the tile util functions are in their own namespace, so I can’t see what might be causing this. Can you send the project that’s having the issue? I should be able to fix it if it’s actually a problem with my extension…  
(@Stickman4269 cause this didn’t send as a reply to your post for some reason)

---

<div class="post-metadata">

### Author: ![Stickman4269](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/stickman4269/32/23582_2.png) [@Stickman4269](https://forum.makecode.com/u/Stickman4269)
#### Post date: [April 8, 2025, 11:42pm UTC](https://forum.makecode.com/t/adding-cursor-support-to-the-mini-menu-extension/34903/16 "2025-04-08T23:42:25Z")

</div>

> [@WoofWoof](#):
>
> I should be able to fix it if it’s actually a problem with my extension…

The issue turned out to be that I was importing the demo project for some reason instead of the actual extension. The error was that they were both exporting the Transparency16 const.

---

<div class="post-metadata">

### Author: ![WoofWoof](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/woofwoof/32/32523_2.png) [@WoofWoof](https://forum.makecode.com/u/WoofWoof)
#### Post date: [April 9, 2025, 2:29am UTC](https://forum.makecode.com/t/adding-cursor-support-to-the-mini-menu-extension/34903/17 "2025-04-09T02:29:39Z")

</div>

Oh, yeah, that error is the one that pops up first when you have duplicate “tilemap.ts” files, so that makes sense! I actually have no idea how to import the demo (test files) without just importing the extension as its own project, so that’s weird!

---

<div class="post-metadata">

### Author: ![Gl125371](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/gl125371/32/29131_2.png) [@Gl125371](https://forum.makecode.com/u/Gl125371)
#### Post date: [April 11, 2025, 5:18pm UTC](https://forum.makecode.com/t/adding-cursor-support-to-the-mini-menu-extension/34903/18 "2025-04-11T17:18:55Z")

</div>

Hi, @WoofWoof is there a way so that when my mouse hovers over one of the menu items, if it is bigger than the screen, it scrolls sideways to show the whole thing?

---

<div class="post-metadata">

### Author: ![WoofWoof](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/woofwoof/32/32523_2.png) [@WoofWoof](https://forum.makecode.com/u/WoofWoof)
#### Post date: [April 11, 2025, 10:22pm UTC](https://forum.makecode.com/t/adding-cursor-support-to-the-mini-menu-extension/34903/19 "2025-04-11T22:22:18Z")

</div>

Bigger than the screen or longer than the width of the menu sprite?

I believe it will already scroll after a second or two if the text is longer than the menu. That’s a mini menu feature. Idk about if it’s an image longer than the menu, I’ve never tested that.

If you are talking about physically moving the menu sprite if the sprite itself is off the screen, I’m going to say that you can definitely figure out how to do that yourself if you really want to.  
Personally, I like my menus to be fully in the screen, and the cursor can’t go off the edge of the screen, so if your menu is off the screen, it obviously can’t be controlled by the cursor unless I pull out some real fancy stuff somehow.

If you are talking about the menu going below the screen and being un-scroll-down-able, that can be fixed by using the “scroll menus down” block when the cursor is at the bottom of the screen, which I’m sure you can figure out!

---

<div class="post-metadata">

### Author: ![Gl125371](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/gl125371/32/29131_2.png) [@Gl125371](https://forum.makecode.com/u/Gl125371)
#### Post date: [April 11, 2025, 11:55pm UTC](https://forum.makecode.com/t/adding-cursor-support-to-the-mini-menu-extension/34903/20 "2025-04-11T23:55:20Z")

</div>

I mean the text is longer than the width of the screen. My code is what you showed us in the image, specifically the On Left Mouse Button Pressed code.

[Next page](https://forum.makecode.com/t/adding-cursor-support-to-the-mini-menu-extension/34903.md?page=2)
