2

I thought this would work, but didn't

GraphicsWindow.KeyDown = KeyDown

Sub KeyDown
   If GraphicsWindow.LastKey = "W" And GraphicsWindow.LastKey = "Space" Then
      Do Stuff
   EndIf
EndSub

I need a solution to this so I can get more than one keyboard input at a time from a user

Auxhil
  • 21
  • 3

1 Answers1

2

Here you go! This should do what you need!

GraphicsWindow.KeyDown = KeyDown
GraphicsWindow.KeyUp = KeyUp

While 1 = 1
Program.Delay(10)
If Key["Space"] = "True" And Key["Up"] Then
 TextWindow.WriteLine("DOING STUFF!")
EndIf
EndWhile


Sub Keydown
LastKeyDown = GraphicsWindow.LastKey
Key[LastKeyDown] = "True"
EndSub

Sub KeyUp
LastKeyUp = GraphicsWindow.LastKey
Key[LastKeyUp] = "False"
EndSub
Zock77
  • 951
  • 8
  • 26
  • 1
    right but it wont always be space and up, what happens if he wants it to be with any key? – Matthew Feb 24 '16 at 15:52
  • Pretty simple, Just replace the key inside the quotes to what you need: Key["W"] Or Key["Control"] – Zock77 Feb 25 '16 at 00:11
  • erm, right but lets say your playigna top view gta style game - you got diaganals as well, that makes to 4 moves (coortesian plane movement,) and 4 diaganoles, so you will have to have 8 if statements correct? is there any way to make it more effiecient? and how would you just debug that (just wodnering cuz i doa lot of debugging?) – Matthew Feb 26 '16 at 02:19