Arrow keys are broken

When I try to hold down an arrow key (or use wasd), instead of it being held, it has the same sort of repeating like when you hold down a key in a text editing program (aka it types the symbol once and then it starts repeating after a delay). The joystick or what do you call it doesn’t work either and simulates ONE keypress and doesnt even repeat. This also breaks all of the controller code blocks. I’m not sure whats causing this, I don’t think it’s because I’m using chrome, unless microsoft really wants you to use ms edge. I’ve tried setting the button repeat delay with the code block from controller, but that doesn’t work either. If anyone has any suggestions on how to fix this it’d be great. thx

2 Likes

Share code? Might be a simple fix!

2 Likes

Hi, the issue is not the code - I’ve looked at tutorials and tried different things with the code + on the little simulation handheld graphic the arrow keys show exactly the same inputs that I’ve said before - that weird repeating. I think it’s more of a software issue and maybe theres a way to fix that which is what I’m asking for

3 Likes

Ohhhhhh! Does this happen in other places? Obviously when editing text it’s intended, but what about other stuff? I’m wondering if it’s maybe a keyboard issue? If you open someone’s shared game is the same thing happening? Does it happen in a new project? If it’s only in this one project, please share the project because it might be something weird happening, idk.

1 Like

It happens everytime, no matter the project. I think it’s maybe a setting either in the browser or the operating system, but I’m not sure since i can play a lot of browser games just fine. Also it’s not happening with Z and X (the A and B buttons) which makes me think this is MakeCode’s issue with the dpad key detection

2 Likes

Weirrdddddd… @MakeCode ever seen this before? Also, @richard, I’ve been using you as my call to the Makecode knowledge gods so far, but is @Makecode a better option? I’m assuming it’s an account the whole team shares or something, so would it be better to @ that one in the future or no?

1 Like

I’m pretty sure this is intended, cause it happens when I use it too. I made a demo for a practical use for it:

I do believe for your purposes, you could have an on game update loop with an if statement that checks if a button is pressed:

3 Likes

To be fair this functionality can be usefull when you want code to trigger once after user keypress, but I’ve seen platformer games on makecode arcade and they are not playable with this at all.
Also the thing where I’d put the key detection into the main loop doesn’t work either. As i said i think it’s a makecode key detection bug, mosty because A and B works but the arrow keys don’t

1 Like

i haven’t seen this before, no. does sound like either an OS setting or something to do with your keyboard. do you have any accessibility settings turned on the in the OS?

@WoofWoof either works!

3 Likes

I’ve found out something interesting:
for me the html/js events “keypress” and “keydown” behave the same and are most likely to be blamed for this. Also when I said that A and B were working fine I didn’t realise that the visuals could also be incorrect and haven’t really tested it.
Anyways if anyone knows how to fix that it’d be amazing.
I wonder how haven’t I encountered this before

1 Like