# Browser events extension BUG?

**URL:** <https://forum.makecode.com/t/browser-events-extension-bug/35709>\
**Category:** Help\
**Tags:** extension\
**Created:** [April 15, 2025, 3:47am UTC](https://forum.makecode.com/t/browser-events-extension-bug/35709 "2025-04-15T03:47:18Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![SouperMediocre1](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/soupermediocre1/32/22579_2.png) [@SouperMediocre1](https://forum.makecode.com/u/SouperMediocre1)\
**Post date:** [April 15, 2025, 3:47am UTC](https://forum.makecode.com/t/browser-events-extension-bug/35709/1 "2025-04-15T03:47:18Z")

</div>

Using the browser events extension, i was creating a test program to shoot an arrow towards the cursor. in doing so, i added a system that sent the arrow farther the longer you held down the mouse button.

unfortunately, i found a bug. if you click while an arrow is already in flight, it keeps “is mouse 1 pressed” to true, meaning that the variable that controls the arrows flight power is constantly increasing.

here is a link to the program: [https://arcade.makecode.com/S44955-90244-84676-50848](https://arcade.makecode.com/S44955-90244-84676-50848)

---

<div class="post-metadata">

**Author:** ![mosinjack](https://avatars.discourse-cdn.com/v4/letter/m/eada6e/32.png) [@mosinjack](https://forum.makecode.com/u/mosinjack)\
**Post date:** [April 15, 2025, 8:05pm UTC](https://forum.makecode.com/t/browser-events-extension-bug/35709/2 "2025-04-15T20:05:15Z")

</div>

It looks like you’ve encountered an interesting issue! The bug you’re describing might be related to how the “is mouse 1 pressed” condition is being handled while the arrow is in flight. To resolve this, you could consider adding a check to make sure that the arrow is not already in motion before accepting new inputs. I’d recommend adding a variable to track whether the arrow is in flight, and only updating the power if the arrow is not already flying. Hope this helps!

---

<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:** [April 15, 2025, 8:47pm UTC](https://forum.makecode.com/t/browser-events-extension-bug/35709/3 "2025-04-15T20:47:52Z")

</div>

@SouperMediocre1 this is happening because you are pausing in the button handler; try wrapping all the code in the “on button pressed” event inside a “separately do” block from the timers extension

---

<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:** [April 15, 2025, 10:46pm UTC](https://forum.makecode.com/t/browser-events-extension-bug/35709/4 "2025-04-15T22:46:07Z")

</div>

i’ve opened a pr to make it so that these buttons behave more like the controller buttons. should prevent this from happening: [https://github.com/microsoft/pxt-common-packages/pull/1515](https://github.com/microsoft/pxt-common-packages/pull/1515)

---

<div class="post-metadata">

**Author:** ![SouperMediocre1](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/soupermediocre1/32/22579_2.png) [@SouperMediocre1](https://forum.makecode.com/u/SouperMediocre1)\
**Post date:** [April 16, 2025, 5:37pm UTC](https://forum.makecode.com/t/browser-events-extension-bug/35709/5 "2025-04-16T17:37:19Z")

</div>

ok, I’ll try that and I’ll check out the pr, thanks.

---

<div class="post-metadata">

**Author:** ![SouperMediocre1](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/soupermediocre1/32/22579_2.png) [@SouperMediocre1](https://forum.makecode.com/u/SouperMediocre1)\
**Post date:** [April 16, 2025, 5:58pm UTC](https://forum.makecode.com/t/browser-events-extension-bug/35709/6 "2025-04-16T17:58:50Z")

</div>

I tried doing this, didn’t work so I removed the code.
