gmamaladze / globalmousekeyhook

This library allows you to tap keyboard and mouse, detect and record their activity even when an application is inactive and runs in background.
MIT License
1.05k stars 257 forks source link

(Question) Handle Mouse Click Event #124

Open vozeldr opened 4 years ago

vozeldr commented 4 years ago

I'm interested in MouseDownExt events. The use case is the user clicks a button in the application and it starts listening for this event. When the user clicks somewhere and the event is handled, I mark the event has Handled but the Click event still fires on the element that was under the cursor where I clicked. I want to handle the Click event but the MouseClick event handler doesn't have a Handled property. How can I accomplish this so the focus doesn't change and the click event doesn't fire on the element under the cursor?

vozeldr commented 4 years ago

If I listen for both MouseDownExt and MouseUpExt and mark both as Handled, it seems to do what I want. If that's the correct/best solution, please close.