I made a project that works with the “key any pressed” block. For some reason, sometimes when I start the project it activates despite me not touching anything. I tested every key and apparently it’s reporting that shift and alt are being pressed, when they aren’t. Clicking the green flag again to restart usually fixes this, but I don’t want it to show up in the first place.
If you hold a key when you click off the tab, it will think that you are still holding that key until you press it again.
Is there a way to prevent this? Its supposed to have a forever script checking if the key is held or not, so I don’t know what else to do.
I mean, just don’t hold any keys whenever clicking off the tab. This is also a problem I have experienced on other websites. I’m not sure this is the problem you are experiencing though…
Thanks!
You can also just press the keys again and they should stop reporting as being pressed. I know when I press ctrl shift + tab to leave the snap tab, and I come back, shift is being reported as pressed, so I have to press shift again to make it not be pressed.
Unfortunately this is just a thing with almost every website. Heck, I remember abusing it in scratch. So there’s not much you can do to prevent it.
There was a platformer project that involved mostly going upward in one level, and my finger was getting tired. I accidentally discovered that it could be made easier if I, say, went alt-tab while holding up and let go on the other window. Then I just had to worry about side-to-side timing.
It seems like the “when key pressed” hat is unaffected, which makes sense as it is dependent on your computer saying “they have key repeat enabled, so I guess I’ll tell the program that the key is pressed now”, while the “is key pressed” predicate I’m guessing does something along the lines of “the computer said the key was pressed, and hasn’t told me it isn’t pressed anymore yet, so it must still be pressed”.
what if it was a loop that checked if the key is being pressed then checks if its not. Sure it thinks you’re still pressing the key when it comes back on but i wonder if checking if you’re not pressing it after will affect it. I don’t know how this would look exactly but there might be a clever way to prevent your project from experiencing this… not sure though…