There is an unsaved comment in progress. You will lose your changes if you continue. Are you sure you want to reopen the work item?
MouseClick Event not raised for AppHooks
I was poking around with the Hook Listener demo and noticed it wasn't raising MouseClick events unless the hook was a global. As currently I only want to capture mouse events on a single window, I don't want to enable a global handler.
I had a quick look at ProcessMouseClick in MouseHookListener.cs and found it would only raise the event if m_DownButtonsWaitingForMouseUp was set. This variable is only set for global hooks according to a comment in the same file.
I changed the if statement in the ProcessMouseClick function to
if ((!IsGlobal && e.Button != MouseButtons.None) || (IsGlobal && (m_DownButtonsWaitingForMouseUp & e.Button) != MouseButtons.None))
This then allowed me to correctly catch click events on the app hooks.
I considered creating a patch, but as it's only one line of code and not knowing how the rest of the system works it's possible that my fix isn't the best way of doing it, therefore I've just logged this issue so you're aware of the bug and can fix it however
you see fit.