Keydown fails with 3 keys, depending on order

BlitzMax Forums/BlitzMax Programming/Keydown fails with 3 keys, depending on order

JoshK(Posted 2006) [#1]
The following code will fail to detect key presses, depending on the order the keys are pressed. Using the shiftkey as a modifer to make a player walk or run is a common control method, and is how I came across this error:
win:TGadget=CreateWindow("",0,0,400,300)

ActivateGadget CreateCanvas(0,0,400,300,win)


enablepolledinput()

While WaitEvent()<>EVENT_WINDOWCLOSE
	SetGadgetText win,KeyDown(KEY_UP) + KeyDown(KEY_RSHIFT) + KeyDown(KEY_NUM0)
Wend



Who was John Galt?(Posted 2006) [#2]
Most likely a limitation of your keyboard. Most keyboards use a grid system to detect keypresses and once 3 or more keys are pressed the info sent to the decoder is not unique to a specific set of keys.