Posts: 4,698
Threads: 222
Joined: Apr 2022
Reputation:
322
(08-16-2023, 01:11 AM)TerryRitchie Wrote: I could have swore there was a discussion about this before, either on this forum or previous forums, but my searches have come up empty.
How can I detect when the mouse pointer has left the program window?
I seem to remember someone showing how to use an API call ( @SpriggsySpriggs ?) but I didn't have the foresight to add it to my tool box of goodies.
Any suggestions?
Yeah the OS should know where the mouse is, Spriggsy good call, have to decide by OS what "API" to call assuming Linux has similar function and why wouldn't it, sure @mnrvovrfc will be here to the rescue at mention of Linux and most it's Distros ;-))
OS should also know where the QB64 screen is so by deduction if mouse isn't on QB64 screen it "has left the building".
724 855 599 923 575 468 400 206 147 564 878 823 652 556 bxor cross forever
Posts: 811
Threads: 128
Joined: Apr 2022
Reputation:
135
08-16-2023, 07:13 PM
(This post was last modified: 08-16-2023, 07:43 PM by Dav.)
Yep, BYVAL is needed. Glad you got it working!
(had to come right back home, gig was cancelled at last minute)
EDIT: By the way, there are some more calls that API can do for additional MOUSE info, like see if scroll wheels are present, or if L/R mouse buttons are currently swapped.
- Dav