Page 1 of 1

Post a mouse event

Posted: Tue Feb 11, 2025 9:37 am
by clp1000
Hello

Is there any way to send a Left Mouse Click to the event queue using PostAppEvent() ?
If so, please can you tell me how. Or is there another method?

Thanks
Chris

Re: Post a mouse event

Posted: Tue Feb 11, 2025 10:08 am
by Tom
Hi, Chris.

What exactly do you want to do? Activate a button? Set the mouse somewhere? Mark a browse line?

You can send almost all of the events you find enumerated in appevent.ch, but in most cases, you need a target for the event. It's better practice to directly send the needed event (like xbeBRW_ItemMarked to force a browse line to be marked) instead of mouse- or keyboard-events. It's much better practice to activate/evaluate the slot needed, for instance the activate-slot of a pushbutton.

Re: Post a mouse event

Posted: Wed Feb 12, 2025 4:00 am
by clp1000
OK thanks

To be honest, it's some very old code and the mouse is staying part-clicked ( dragging highlight ), I just want to send a Click to the screen at a certain position to free it up
The same way we'd use the following to force ENTER to be invoked :- PostAppEvent( xbeP_Keyboard, xbeK_ENTER,, o )

Thanks
Chris

Re: Post a mouse event

Posted: Wed Feb 12, 2025 9:32 am
by rdonnay
You could try PostAppevent(xbeM_LbUp, ... )
if PostAppEvent(xbeM_LbClick, ... ) doesn't work.