check key released!!

BlitzMax Forums/BlitzMax Beginners Area/check key released!!

DreamLoader(Posted 2009) [#1]
i want to check the key released in game and i check the
input module,it use hook to active Event_KEYUP, i wonder
if there is another way instead of using hook!!
any idea???


MGE(Posted 2009) [#2]
hard code it?

'
Global done:Int
Global spacekeydown:Int
'
Graphics(500,500,0)
'
Repeat
 '
 Cls()
 '
 If KeyHit(key_escape)
  done=1
 EndIf
 '
 If spacekeydown = 1
  If KeyDown(key_space)=0
   spacekeydown=0
   '
   ' released here
   '
  EndIf
 Else
  If KeyDown(key_space)
   spacekeydown=1
  EndIf
 EndIf
 '
 DrawText("SpaceKey:"+spacekeydown,20,20)
 '
 Flip(1)
 '
Until done



Perturbatio(Posted 2009) [#3]
you could poll the events rather than using a hook.


DreamLoader(Posted 2009) [#4]
thanks,clean one