I see. Is there a "squish" users forum? You might get more help there by people familiar with it.

What gets sent to your "mouse_event" callback function? If there is a pointer to the event itself, you can still use the event type to select out the ones you want.

Which make the function gets called thousands of times and misses my code.
I do not know what you mean by "misses my code". The "mouse_event" function is something you have written, right?