# Browser Events get pressed key

**URL:** <https://forum.makecode.com/t/browser-events-get-pressed-key/42835>\
**Category:** Help\
**Tags:** extension\
**Created:** [March 22, 2026, 7:25am UTC](https://forum.makecode.com/t/browser-events-get-pressed-key/42835 "2026-03-22T07:25:49Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ayoub](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/ayoub/32/35544_2.png) [@Ayoub](https://forum.makecode.com/u/Ayoub)\
**Post date:** [March 22, 2026, 7:25am UTC](https://forum.makecode.com/t/browser-events-get-pressed-key/42835/1 "2026-03-22T07:25:49Z")

</div>

Hello,

Apologies if this has been asked before. I wanted to know if there’s a way to modify the browser events extension so that it returns which key was pressed / released instead of having to manually check for every single key.

Thank you.

---

<div class="post-metadata">

**Author:** ![randomuser](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/randomuser/32/32505_2.png) [@randomuser](https://forum.makecode.com/u/randomuser)\
**Post date:** [April 14, 2026, 11:30pm UTC](https://forum.makecode.com/t/browser-events-get-pressed-key/42835/2 "2026-04-14T23:30:17Z")

</div>

Apologies for the lateness, but there is the [💻 Custom Keybinds Extension AKA MORE BUTTONS!](https://forum.makecode.com/t/custom-keybinds-extension-aka-more-buttons/24416) extension which distinguishes between them!

---

<div class="post-metadata">

**Author:** ![Ayoub](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/ayoub/32/35544_2.png) [@Ayoub](https://forum.makecode.com/u/Ayoub)\
**Post date:** [April 15, 2026, 12:06am UTC](https://forum.makecode.com/t/browser-events-get-pressed-key/42835/3 "2026-04-15T00:06:16Z")

</div>

Thank you for reaching out! Please, no apologies needed. I have used the extension before. It’s very nice but I don’t see any blocks that tells me which button the user pressed sadly.

---

<div class="post-metadata">

**Author:** ![randomuser](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/randomuser/32/32505_2.png) [@randomuser](https://forum.makecode.com/u/randomuser)\
**Post date:** [April 15, 2026, 8:43pm UTC](https://forum.makecode.com/t/browser-events-get-pressed-key/42835/4 "2026-04-15T20:43:34Z")

</div>

Ah, yeah, I was misremembering it! 🙃  
It seems there’s no built-in way to do this, but you can use a function like this:

 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/8/8/885b6ca49e22e75f34518aa0170fccddadcbf1ec.png)

Which basically checks all of the keys and returns the first one that is true (If you expect your player will press multiple, though, you could make it return an array instead).

[Here’s the link if you want to use the function!](https://makecode.com/_iyDfJcXTAMhM)

---

<div class="post-metadata">

**Author:** ![Ayoub](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/ayoub/32/35544_2.png) [@Ayoub](https://forum.makecode.com/u/Ayoub)\
**Post date:** [May 13, 2026, 12:23am UTC](https://forum.makecode.com/t/browser-events-get-pressed-key/42835/5 "2026-05-13T00:23:34Z")

</div>

Thank you! I ended up using the on “X” key pressed events. As scuffed as it looks, it at least servers its purpose well ahah.
