Mouse Click

Just starting out? Need help? Post your questions and find answers here.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by urland.

When using the EventType() function, is it only possible to detect a left mouse button click when the pointer is over a gadget of some sort? I'm trying to detect a mouse click when clicking anywhere within a window and cannot get EventType() to work in this fashion. Thanks. (Win2K Pro PB 3.1)
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by PB.

> When using the EventType() function, is it only possible to detect a left
> mouse button click when the pointer is over a gadget of some sort?

I think so, but you can always check for a left-click like so:

Code: Select all

EventID=WaitWindowEvent()
If EventID=#WM_LBUTTONDOWN ; Left button clicked!
  ; Do whatever
EndIf

PB - Registered PureBasic Coder
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by urland.

[quote]
I think so, but you can always check for a left-click like so:

/quote]

Thanks! I'll give it a try.
Post Reply