Can't find mouse out of window post

BlitzMax Forums/BlitzMax Programming/Can't find mouse out of window post

Chroma(Posted 2007) [#1]
I saw it in here but now I can't find it. How to detect if the mouse has left the BMax window (in windowed mode)?


kronholm(Posted 2007) [#2]
if xmouse() > windowwidth or xmouse() < 0 or ymouse() > windowheight or ymouse() < 0 ?


Damien Sturdy(Posted 2007) [#3]
I'm pretty sure that doesn't work unless the mouse button is down Kronholm :(

At least in my project, the mouse stops returning values when it leaves the window, unless I have a mouse button down. Pain in the arse. maybe Externing some api might fix it...


tonyg(Posted 2007) [#4]
Does this help?
Graphics 800,600,0
Local mousepos:String="IN"
While Not KeyHit(KEY_ESCAPE)
 Cls
 PollEvent()
 Select EventID()
    Case EVENT_MOUSEENTER
      mousepos="IN"
    Case EVENT_MOUSELEAVE
      MOUSEPOS="OUT"
  End Select
  DrawText MOUSEPOS,0,0
  Flip
Wend
If not, take deep breaths :)
<edit> and please let it drop and not post any more derogatory remarks (witty or not) in unrelated posts.


Chroma(Posted 2007) [#5]
That's it I think. I saw that exact code in another post somewhere but couldn't find it again. Thanks.

and please let it drop and not post any more derogatory remarks (witty or not) in unrelated posts.

Gah, still bringing that up? Let it rest man. Long as you're nice I am too. :)