check key released!!
BlitzMax Forums/BlitzMax Beginners Area/check key released!!| 
 | ||
| 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??? | 
| 
 | ||
| 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
 | 
| 
 | ||
| you could poll the events rather than using a hook. | 
| 
 | ||
| thanks,clean one |