a mouseclick vs a held mouse

BlitzMax Forums/BlitzMax Beginners Area/a mouseclick vs a held mouse

SSS(Posted 2007) [#1]
hey everyone I was wondering whether there were any built in commands to handle a clicked mouse vs a dragged mouse?


GfK(Posted 2007) [#2]
MouseHit()
MouseDown()


SSS(Posted 2007) [#3]
the problem with that is that mousehit() returns true even if you continue holding the mouse. I mean I hve code that works alright, I was just wondering if there was something easier.


GfK(Posted 2007) [#4]
MouseHit() only returns 'true' if you click the mouse. It will continue to return 'false' thereafter until you click the mouse button again.

Working example:
'check results in the output window
Graphics 640,480
While Not KeyDown(key_escape)
	Cls
	If MouseHit(1)
		Print "Mouse clicked"
	EndIf
	Flip
Wend


You should post some code.


SSS(Posted 2007) [#5]
Basically it's for a RTS game that I tried to start last night. It needs to differentiate between a single click and click that continues to be held down. I have some code that gives the desired functionality that I can post but it's not exactly clean. In fact, that's the reason why I wanted to see if there was a built in way of doing it.