How do I get the mouse-on-screen coordinates with maxgui? Not using classic Graphics, just a maxgui-window here. I want to make my own dragbar in my own window. Made it before in B+, went well.. it's just that I need the mouseposition on the screen in maxgui..!
mousex(), mousey()
BlitzMax Forums/BlitzMax Programming/mousex(), mousey() Check for the mousemove event, it holds the mouse position.
Eric: doesn't work. I need the mousecoord on the screen, not the coordinate on a canvas/panel, just the way it worked in B+! I need to compare my canvas-x/y with the screen x/y, that's why I need screencoords. :P
oh I misunderstood.. Does EnablePolledInput() Work?
nope...I just tried it.
nope...I just tried it.
nope, besides I refuse any polling on this planet. Events it will be and stay.. :P
Think you need GetCurrentPositionEx()
where to find/how to use?
Type TPoint Field X Field Y End Type Function ccGetCursorPos:TPoint() 'Returns a TPoint ?Win32 Local point:TPoint = New TPoint If Not GetCursorPos(point) Then ccRunTimeError ("Error Getting Cursor Pos") Return Null Else Return point EndIf ? End Function
This get's it relative to the desktop top left, not sure if it helps. BUT you can work out your window (or client area) top left and calc the X Y in the app. All part of my Game Framework ;-)
erhm, what's GetCursorPos ? :P And is it multi-platform anyway?
hm, dunno if it works.. it only returns the 'screencoord' from a canvas, not just the coord of 'whatever'.. have to try. Anyway, the classic mousex() and mousey() from B+ are lost it seems..
what only returns screen coord from a convas? My code returns relative to the desktop for sure I use it!
hm.. I don't think it works.. it bugs.. and it's more or less 1:1 c/p'ed from a B+ source where it worked..
Bottomline: someone oughta bring back the mousex/y from the grave, where they'll work everywhere on screen.., in any circumstances!
Bottomline: someone oughta bring back the mousex/y from the grave, where they'll work everywhere on screen.., in any circumstances!