Why does this tiny mouse prog crash?

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 halo.

Possible to check mousebuttons without opening a screen?

I'd like a mousepressed() DLL so I can check the mouse when it goes outside the Blitz program window. If PB can't do it, can anyone give me a DLL to do it?

I am really happy with the way PB is helping me with the next version of CShop. A lot of the program is being written in PB.
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 halo.

Sorry, that subject title made no sense.
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.

> Possible to check mousebuttons without opening a screen?

At the start of your app:

Code: Select all

getasynckeystate_(#VK_LBUTTON) ; To clear mouse buffer.  Do the same for RBUTTON/MBUTTON if required.
Then, when you want to test it later:

Code: Select all

If getasynckeystate_(#VK_LBUTTON)=-32767
  Debug "Left mouse button is down!"
EndIf

PB - Registered PureBasic Coder
Post Reply