Multiple key presses

Blitz3D Forums/Blitz3D Programming/Multiple key presses

Moraldi(Posted 2007) [#1]
Is it true that when two keys are pressed in the same time then Blitz3D cannot detect a third key press?
take a look into the following code to see what I mean:
While Not KeyHit(1) 

	If KeyDown(203) And KeyDown(200) 
		Print "I am moving diagonal!" 
	Else
		Print
	EndIf
	If KeyDown(57) Print "I am firing!"

Wend 




_33(Posted 2007) [#2]
Well, usually you would fire from the mouse! Why not choose jumping instead?


H&K(Posted 2007) [#3]
Its down to the keyboard I think


Moraldi(Posted 2007) [#4]
_33:
This is not working also:
While Not KeyHit(1) 

	If KeyDown(203) And KeyDown(200) 
		Print "I am moving diagonal!" 
	Else
		Print
	EndIf
	If KeyDown(57) Print "I am jumping!"

Wend 




GitTech(Posted 2007) [#5]

This is not working also:



Both examples work fine here.



Its down to the keyboard I think



Yep :-)


b32(Posted 2007) [#6]
I believe that some keys can not be combined properly, perhaps only on certain keyboards. However, you can combine WASD with space.


Moraldi(Posted 2007) [#7]
It works on my keyboard only for WASD... with SPACE
Thanks all of you


Bobysait(Posted 2007) [#8]
Most keyboards cant' exceed 2 or 3 keys together, as some keys have prioritys. It 's keyboard specific. So, for most gameplay compatibility, try to code without this need.


Rob Farley(Posted 2007) [#9]
The best keys to use for the third key press are alts, ctrls and shifts, these are usally pretty safe to use. But as mentioned already, it's down to the keyboard.


Bobysait(Posted 2007) [#10]
take care using those keys , you could enable the "multi ctrl key" that open the windows menu for shortcuts.