DAY 016: _MOUSEINPUT
#22
(12-06-2022, 01:39 AM)OldMoses Wrote:
(11-22-2022, 02:00 AM)SMcNeill Wrote: @Pete If you're going that complex, use MBS: https://staging.qb64phoenix.com/showthread.php?tid=138

MBS pretty much does everything I need a mouse to do, and more that I haven't quite figured out yet. I haven't done any "hold and release" type stuff.

Once I've grabbed a mouse button event, the very first step in processing it is to clear the buffer with:

Code: (Select All)
SUB Clear_MB (var AS INTEGER)
    DO UNTIL NOT _MOUSEBUTTON(var)
        WHILE _MOUSEINPUT: WEND
    LOOP
END SUB 'Clear_MB

A bit loopy for a solution, but so far, I've had no more click through events.

Oh I've made mouse routines far more complex than that one. That's why I labeled it as, "mini_mouse".

One thing you might want to consider is...

Code: (Select All)
DO
    _LIMIT 30
    WHILE _MOUSEINPUT: WEND
    IF _MOUSEBUTTON(1) THEN
        Clear_MB var
        BEEP ' It will only beep when mouse button is released.
    END IF
LOOP

SUB Clear_MB (var AS INTEGER)
    DO: _LIMIT 5: WHILE _MOUSEINPUT: WEND: LOOP UNTIL NOT _MOUSEBUTTON(1)
END SUB

If I run it without _LIMIT in the SUB my CPU jumps from 6% to 52%. With _LIMIT it idles at 4%. I mean this will only happen if your cat decides to sit on your mouse. Yes, I have a cat... and yes, it sits wherever the hell it wants! Big Grin

What you use is what I also use when the apps are not very involved. Much faster to type it out and get things running.

Pete
If eggs are brain food, Biden takes his scrambled.
Reply


Messages In This Thread
DAY 016: _MOUSEINPUT - by SMcNeill - 11-21-2022, 11:27 PM
RE: DAY 016: _MOUSEINPUT - by bplus - 11-21-2022, 11:41 PM
RE: DAY 016: _MOUSEINPUT - by SMcNeill - 11-22-2022, 12:09 AM
RE: DAY 016: _MOUSEINPUT - by PhilOfPerth - 11-22-2022, 12:16 AM
RE: DAY 016: _MOUSEINPUT - by james2464 - 11-22-2022, 12:20 AM
RE: DAY 016: _MOUSEINPUT - by SMcNeill - 11-22-2022, 12:32 AM
RE: DAY 016: _MOUSEINPUT - by mnrvovrfc - 11-21-2022, 11:54 PM
RE: DAY 016: _MOUSEINPUT - by PhilOfPerth - 11-22-2022, 12:08 AM
RE: DAY 016: _MOUSEINPUT - by james2464 - 11-22-2022, 12:38 AM
RE: DAY 016: _MOUSEINPUT - by SMcNeill - 11-22-2022, 12:49 AM
RE: DAY 016: _MOUSEINPUT - by mnrvovrfc - 11-22-2022, 12:46 AM
RE: DAY 016: _MOUSEINPUT - by Pete - 11-22-2022, 01:32 AM
RE: DAY 016: _MOUSEINPUT - by SMcNeill - 11-22-2022, 02:00 AM
RE: DAY 016: _MOUSEINPUT - by OldMoses - 12-06-2022, 01:39 AM
RE: DAY 016: _MOUSEINPUT - by Pete - 12-06-2022, 02:28 AM
RE: DAY 016: _MOUSEINPUT - by Pete - 11-22-2022, 02:59 AM
RE: DAY 016: _MOUSEINPUT - by SMcNeill - 11-22-2022, 03:47 AM
RE: DAY 016: _MOUSEINPUT - by Pete - 11-22-2022, 07:54 AM
RE: DAY 016: _MOUSEINPUT - by mnrvovrfc - 12-05-2022, 02:03 PM
RE: DAY 016: _MOUSEINPUT - by Pete - 12-05-2022, 04:02 PM
RE: DAY 016: _MOUSEINPUT - by SMcNeill - 12-05-2022, 04:55 PM
RE: DAY 016: _MOUSEINPUT - by Pete - 12-05-2022, 07:45 PM
RE: DAY 016: _MOUSEINPUT - by OldMoses - 12-06-2022, 02:26 PM
RE: DAY 016: _MOUSEINPUT - by Pete - 12-06-2022, 03:23 PM
RE: DAY 016: _MOUSEINPUT - by NasaCow - 12-10-2022, 12:28 PM
RE: DAY 016: _MOUSEINPUT - by Pete - 12-10-2022, 05:08 PM



Users browsing this thread: 11 Guest(s)