NotifyEvent for mouse click through code

I have my openFrameworks program on my side, and completion of some timing, I have to click wherever the mouse cursor is:

I tried doing the mouse click with the code and used ofNotifyMousePressed(ofGetMouseX(), ofGetMouseY(), 0);
However, as I see this working in my application, it keeps the mouse pressed itself, and I should be de-notifying it some way. I am not full sure if that’s the case or I am mistaken by not being able to track some branch of the code.

Here’s the question: How do I notify mouse click at the place where the mouse is right now and just gird rid of the press (it should not behave as the user has kept the left button pressed)

it’s not a very sophisticated way… but you can do something like:

if(timeToPressMouseBool){
this->mousePressed(ofGetMouseX(),ofGetMouseY(),0);
timeToPressMouseBool=false;
}

use a boolean that will become false after running one time over the code…

There are lots of places where I have to send click events manually through code and I am not sure the above will turn out to be a good method.

ofNotifyMousePressed although works, but does not release the mouse button press afterwards.
ofNotifyEvent(ofEvents.mousePressed, ofMouseEventArgs); also doesn’t seem to help here and gives some error that I don’t remember now.

Such a notification method that just sends the click through the code should already be there inside just that I am not sure about it. Any more suggestions out there that I should try?

hmm, perhaps you just need ofNotifyMouseReleased