Reading Mouse Buttons

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
LCD
Enthusiast
Enthusiast
Posts: 206
Joined: Sun Jun 01, 2003 10:55 pm
Location: Austria, Vienna
Contact:

Reading Mouse Buttons

Post by LCD »

Writing Multiplattform applications is not easy if the mouse buttons status cannot be checked. In games it is okay with ExamineMouse(). On Windows I can use GetAsyncKeyState_() API to read #VK_LBUTTON, #VK_RBUTTON or #VK_MBUTTON, even #VK_NEXT and #VK_PRIOR are possible to read. But these API Function are not Crossplattform Compatible. Reading Events does not help much, as they are in a pipeline, interrupted with other events, and no MButton Event is available, and you cannot read the state of multiple buttons at once. This is a big problem on Linux and Mac. Writting a painter-Application is a pain this way.
Please include a simple mouse button check like GetMouseButtonState(Button). Something outside the "old" Mouse library.
My PC
Ryzen 9 5950, 64 GB RAM, nVidia RTX A4000, Win 10
Ryzen 7 1700, 32 GB RAM, nVidia RTX A2000, Win 10
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6166
Joined: Sat May 17, 2003 11:31 am
Contact:

Re: Reading Mouse Buttons

Post by blueznl »

+237

:-)

Okay, in simple words, I would like this as well :-)
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB)
( The path to enlightenment and the PureBasic Survival Guide right here... )
DarkDragon
Addict
Addict
Posts: 2344
Joined: Mon Jun 02, 2003 9:16 am
Location: Germany
Contact:

Re: Reading Mouse Buttons

Post by DarkDragon »

Hello,

Maybe you want to try this until it may be implemented:

http://www.purebasic.fr/english/viewtop ... ouseButton
bye,
Daniel
LCD
Enthusiast
Enthusiast
Posts: 206
Joined: Sun Jun 01, 2003 10:55 pm
Location: Austria, Vienna
Contact:

Re: Reading Mouse Buttons

Post by LCD »

Nice! This looks good, even if no Macintosh is implemented yet, it is what I was looking for :D
My PC
Ryzen 9 5950, 64 GB RAM, nVidia RTX A4000, Win 10
Ryzen 7 1700, 32 GB RAM, nVidia RTX A2000, Win 10
Post Reply