MouseClick on Window?

Mac OSX specific forum
OrangeJuice
User
User
Posts: 24
Joined: Sat Jul 24, 2010 11:56 am

MouseClick on Window?

Post 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?
jamirokwai
Enthusiast
Enthusiast
Posts: 796
Joined: Tue May 20, 2008 2:12 am
Location: Cologne, Germany
Contact:

Re: MouseClick on Window?

Post 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!
Regards,
JamiroKwai
OrangeJuice
User
User
Posts: 24
Joined: Sat Jul 24, 2010 11:56 am

Re: MouseClick on Window?

Post 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.
Post Reply