Mouse position in window.

BlitzMax Forums/BlitzMax Programming/Mouse position in window.

Retimer(Posted 2007) [#1]
I understand that mousex() and mousey() functions do not work unless you're in fullscreen or something.

How would I get the mouse position either on the entire screen or within a window?

edit: Ah, I should have posted this under MaxGui


Retimer(Posted 2007) [#2]
never mind.
I'm just going to go with a gui lib. The documentation, and features for maxgui don't seem to be worth the pennies it costs.


Dreamora(Posted 2007) [#3]
And your capability to read documentations aren't as well!

In a GUI environment you work with events, not with Max2D polled handling!

Check out assaris MaxGUI tutorials and blame others for their errors afterwards, after you at least have the total pure basic knowledge of event based programming!


Retimer(Posted 2007) [#4]
I have gone through so much documentation looking for small and simple things. I have spent more time on documentation for simple things than I do trial and error using things I've never touched before (such as streams).

To be honest i'm more than pleased with blitzmax. I've bought a stressful amount of software only to find limitations. Blitzmax is the best thing i've come by. But since blitzmax is commercial, I really don't feel guilty about complaining a tiny bit about my product.

Although I maybe should have held onto the trial and checked out the maxgui a little more before paying for it.


Retimer(Posted 2007) [#5]
All I needed. Unfortunately it's only for windows =(

By Mark:
Strict

Extern "win32"
Function GetCursorPos( point:Byte Ptr )
End Extern

Type TPoint
	Field x,y
End Type

Local point:TPoint=New TPoint

Repeat
	GetCursorPos point
	Print point.x+","+point.y
	Delay 100
Forever



Brucey(Posted 2007) [#6]
I posted OS X code somewhere for this once, and I think my GTK (Linux) GUI mod has it included too...

Almost made it into a stand-alone cross-platform mod once, but for one function it seemed a bit like overkill... :-p


Retimer(Posted 2007) [#7]
but for one function it seemed a bit like overkill...


haha :'(. Yeah, it really isn't that important since there's work arounds. But i'll give the forum a search for your post.
I don't even compile for linux/mac at the moment, but I like knowing that if and whenever that I do, that I will be able to without too much work.

cheers


Grey Alien(Posted 2007) [#8]
Without MaxGUI it's only possible by including an Objective C module for MacOS. Recently Brucey helped me get this working and there should be a thread around here somewhere with my resulting code in it. There was also an issue with it if you changed from full-screen to windowed mode which I've fixed since. Anyway, I've added this code to my framework.