keydown for 2 keys
Blitz3D Forums/Blitz3D Beginners Area/keydown for 2 keys
| ||
how can you check if 2keys are pressed ie right and up arrows i tried 'if keydown(200) and keydown(205) then ' but doesnt work thanks |
| ||
Thats how its done. But some keyboard combinations don't work on certain hardware. It isn't Blitz's fault. |
| ||
you could try nesting them i.e. If Keydown(200) then If Keydown(205) then DoStuff() EndIf Endif |
| ||
not that I would do a control system for a game like this, but this works fine for me: |
| ||
Doesnt work for me, man just goes up ElseIf KeyDown(200) Then ;move up If KeyHit(205) Then man\x =man\x +8 If KeyHit(203) Then man\x =man\x -8 blah blah end if |
| ||
Write a seperate program that only checks keys and prints the results to the screen. This will tell you if the problem is with your hardware or if it's with your code. Note that KeyHIT commands can only be used ONCE. If you need to perform several checks on a KeyHIT command than store it into a variable first. down_key = KeyHit(208) If down_key = True Then ... If down_key = True Then ... If down_key = False Then ... |
| ||
GJ, just put the "If Keydown(200)....If Keydown(205)" in seperate If/Endif statements. Blitz is so fast that you can press two keys at the same time and it will process the commands "virtually" simultaneously. You won't even notice the difference. I do it all the time! |
| ||
I don't see the reason why the seperate IF structure should help here. This is a OS issue as far as I know. It works on some systems, on some other systems it doesn't. |