key tap

Blitz3D Forums/Blitz3D Programming/key tap

Akat(Posted 2003) [#1]
i know this one has been asked 2 many times - i just missed the thread (actually i feel not need it at that time - now i need it)...

how do we detect a key continously hit - lets say, i pressed UpArrow to normal run. then if i wanna straff so i have to tap the uparrow twice. how to detect the 'tap' - take teken as an eg. with this key tap orderly, it can create unique movement...


(tu) sinu(Posted 2003) [#2]
maybe something like this, it's late, maybe wrong.

if PunchKeyValue# = 0
if keydown/keyhit(punch)

PunchKeyValue# = 1

endif

elseif PunchKeyValue# > 0
if keydown/keyhit(punch)

doubletap = true

endif

endif

if PunchKeyValue#>0 PunchKeyValue=PunchKeyValue - .1
if PunchKeyValue#<0 PunchKeyValue=0