Page 1 of 1

How should i write this? (sloved)

Posted: Wed Jan 12, 2005 6:32 pm
by Joakim Christiansen
How should i write this?

Code: Select all

Select KeyboardPushed()
   Case #PB_Key_Up
      ;do something
   Case #PB_Key_Down
      ;do something
   Case #PB_Key_Left
      ;do something
   Case #PB_Key_Right
      ;do something
EndSelect
I mean "KeyboardPushed()" don't work this way, how should i do ths?

Posted: Wed Jan 12, 2005 6:46 pm
by Pupil
why not:

Code: Select all

If KeyboardPushed(#PB_Key_Up)
  ; Do something
ElseIf KeyboardPushed(#PB_Key_Down)
  ; Do something
ElseIf KeyboardPushed(#PB_Key_Left)
  ; Do something
endif

Posted: Wed Jan 12, 2005 7:01 pm
by Joakim Christiansen
Yeah it works... :)

Posted: Mon Jan 31, 2005 1:30 pm
by RedmoonX
keyboardinkey()

returns what key thats is pressed

Posted: Mon Jan 31, 2005 4:25 pm
by Joakim Christiansen
It returns the last typed character.
If I press F then it will return the character F.
If I press Left then it returns nothing, so I can't use this to controll something with the arrow keys.

Posted: Mon Jan 31, 2005 7:34 pm
by RedmoonX
ohh :o

that was bad :D

RedmoonX ( Slaughter from gmc )