如何在Small Basic中一次获得多个键盘输入

时间:2016-02-23 00:18:21

标签: keyboard-events smallbasic

我认为这会有用,但没有

GraphicsWindow.KeyDown = KeyDown

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

我需要一个解决方案,这样我就可以从用户那里获得多个键盘输入

1 个答案:

答案 0 :(得分:2)

你走了!这应该做你需要的!

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