Page 1 of 1

MouseClick on Window?

Posted: Tue Aug 24, 2010 6:15 pm
by OrangeJuice
Okay, so i figured out how i can find my Mouse position on a Window by just checking its coordinates whenever an unknown (-1) event happens, but i can't find out how to get an mouse button click on the Window. How do i do that on OS X?

Re: MouseClick on Window?

Posted: Tue Aug 24, 2010 10:14 pm
by jamirokwai
OrangeJuice wrote:Okay, so i figured out how i can find my Mouse position on a Window by just checking its coordinates whenever an unknown (-1) event happens, but i can't find out how to get an mouse button click on the Window. How do i do that on OS X?
Hi OrangeJuice,

try this:

Code: Select all

repeat
 WindowEvent = WaitWindowEvent()
 TheType = EventType()
 if WindowEvent = #PB_Event_Gadget
  If TheType = #PB_EventType_LeftClick
   MX = WindowMouseX(0)
   MY = WindowMouseY(0)
  endif
 endif
forever
Probably, the EventWindow() is not necessary for the WindowMouseX(0), but I don't know exactly.
Good luck!

Re: MouseClick on Window?

Posted: Tue Aug 24, 2010 11:42 pm
by OrangeJuice
That does only works with an Gadget as i understand it, and i can't use one since i have screen on a window in which I'm trying to do things with the mouse. I can't use the screen mouse functions either, since they don't play nice with the gadgets on the screen around it.

I can't even try it right now, since PureBasic doesn't seem to have survived the last crash I caused trying to find an solution for the Mouse pain, I get an "compiler isn't loaded yet" and restart won't help.

Why oh why can't PureBasic just throw more helpful events then -1 on non Windows machines.