Mousex() and MouseY() not tracking

BlitzMax Forums/BlitzMax Beginners Area/Mousex() and MouseY() not tracking

Sashnil(Posted 2005) [#1]
Mousex() and MouseY() are not tracking unless i press a mouse button, then it tracks where i mouse clicked and then i have to press the mouse buton again to make it track further.

so to recap, one click = one position tracked
mouse button pressed down = one position tracked

the code below is soo simple.

Strict
Graphics 800, 600, 32,75
Local testImage:TImage = LoadImage("Image1.bmp", MASKEDIMAGE)

While Not KeyDown(KEY_ESCAPE)
Cls
DrawImage testImage,MouseX(),MouseY()
Flip
FlushMem
WaitKey
Wend
End


tonyg(Posted 2005) [#2]
Take out that waitkey command.


Yan(Posted 2005) [#3]
WaitKey() halts the programs execution until a key (or mouse button) is pressed.

The clue is in the 'wait' bit. ;o)

So do as Mr G suggested. :o)


Sashnil(Posted 2005) [#4]
omg, i feel like such a noob!

i re-read that bit of code like 20 times and didn't catch it.
time for laser surgury!

ty guys,

embarassed, Sash!