Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

alt-tabbing out of the game locks ALT in pressed state #193

Open
Skaruts opened this issue Mar 24, 2023 · 3 comments
Open

alt-tabbing out of the game locks ALT in pressed state #193

Skaruts opened this issue Mar 24, 2023 · 3 comments

Comments

@Skaruts
Copy link

Skaruts commented Mar 24, 2023

When you alt-tab out of the game, both keyboard.ALT and keyboard.ALT_LEFT get locked in pressed state. This happens both in the browser and in the standalone version.

I'm on windows 7, using Brave browser.

It's easy to replicate:

update = function()
  print(keyboard.ALT)
end

Do that, run the game and alt-tab away, and when you come back the console will be printing 1.

(Also happens with the game paused.)

@JmeJuniper
Copy link

This isn't fixable on microstudio's end, I don't believe, it happens to everything (that is, holding down a key when you switch to a different tab causes the key to stay held). The way to fix it is just to hit alt again. However, if the print statement is activating while the game is paused, that seems like a real bug? Unless I misunderstood what you are saying, which is likely XD

@Skaruts
Copy link
Author

Skaruts commented Mar 25, 2023

I was thinking there might be something in JS that detects when the game loses focus, and if so, maybe it can then make sure input isn't being wrongly received. I could be wrong. Usually engines can detect that, but I've no idea when it comes to JS.

(In fact, not just alt-tabbing, you can hold any key and click outside the game view, and that key will be locked in pressed state.)

About the pause thing, I'm not quite being able to reproduce it now. But just to be clear, I was talking about when you pause it in the code tab.

@Skaruts
Copy link
Author

Skaruts commented Mar 25, 2023

This also happens in the sprite editor, when you alt-tab away. When you get back, sometimes you are stuck in the eye dropper tool until you press alt to get rid of it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants