Keyboard - Any key pressed?

Blitz3D Forums/Blitz3D Programming/Keyboard - Any key pressed?

Tyler(Posted 2003) [#1]
Anyone know of a way to check to see if any key is or isn't pressed. Not a single key, but any key what so ever. For example, my guy walks when I press the forward, back, and side button (respectively). But I want him to idle if I'm not pressing anything. I'm using KeyHit to send my animation commands, but can't figure out how to tell the loop whether or not no keys are pressed. Thanks.


Tyler(Posted 2003) [#2]
If KeyHit (17)

Animate p_arms, 1, .5, 1, 20
anim_x#=1

Else If KeyHit (30)

Animate p_arms, 1, .5, 1, 20
anim_x#=1

Else

If anim_x = 1
Animate p_arms, 0, .5, 0, 20
anim_x#=0
End If

End If

If Not Animating(p_arms)
Animate p_arms, 1, .5, 0, 10
End If


--- That else statement is what's messing me up, or it's the keyhits ... I need to tell the program Else If (NO KEY IS PRESSED)? ... etc ... any ideas?


Tyler(Posted 2003) [#3]
Nevermind I figured it out :) I, Sir, am an idiot.