How to detect mousedown in plugin UI component?


#1

Hi.

I’m doing a plugin host application based off the JUCE Plugin Host example.

I’d like to be able to detect when a mouse-down (or mouse-up) occurs in the plugin’s UI component. Try as I might, I haven’t been able to pull this one off. Things I’ve tried without success:

  1. added a mouse listener to the UI’s component and subcomponents – mouse events never arrive
  2. added transparent view atop of the UI component and tried listening to its mouse events – component doesn’t end up above the UI regardless what I do with Z-order.
  3. Added a global mouse listener to the containing window
  4. I’ve spent a good couple of hours placing breakpoints inside of ComponentPeer for the window, and have yet to trap a mouse down-event there either.

What’s gobbling-up these mouse events? There’s got to be a way to detect mouse interaction with the plug-in’s UI component. It’s just another JUCE component… what am I missing here?

/Jay


#2

Yeah, not possible I’m afraid. The OS will send the events to the plugin’s window directly, bypassing the host app, so you’d need to do horrible OS-level event hooking to intercept them.