Windows Keyboard arrow check bug

Aaron Craig

Member
Greetings.
I believe there's a small bug when checking the arrow keys and the spacebar (spacebar appears to be the worst culprit, though I've tried other keys and they have problems, too). I've got this code inside of an object:

if(keyboard_check(vk_right))
x += 15;
if(keyboard_check(vk_left))
x -= 15;
if(keyboard_check(vk_up))
y -= 15;
if(keyboard_check(vk_down))
y += 15;
if(keyboard_check(vk_space))
show_message("fire");

And when I hold any combination except up and right, spacebar doesn't trigger. I've tried it in separate events for each key, I've tried beginning and end steps, I've tried different projects, different logins, but it always doesn't work.
If I switch it to WASD movement, then it does. This makes me think it's something specific with the arrow keys and the way gamemaker handles them being pushed down.
I have even set the movement to WASD, gotten spacebar to work properly, then mapped the arrow keys to WASD and tried it, and it doesn't work. It's something specific about the arrow keys being pushed down.

I don't think I'm overlooking anything obvious, but if I am please point it out.
 

Carnivius

Member
Not a Game Maker bug. It's a keyboard limitation.
Easy work around is don't use Space with cursor keys. Most folks use Z or X or other keys in that area as an action key instead.
 

Carnivius

Member
is ok. Also keys like Ctrl, Alt and Shift are usually exempt from the limitation because they are designed as standard to be held down with other keys but some players like myself find them a bit awkward (especially with the Windows key between ctrl and alt which can be accidentally pressed and be annoying) :p
 
Top