I'd like to use clicks with the third/middle mouse button in a WebView
to open the clicked links as new Tab. But how can this be done?
I've already tried the following:
1) subclassing WebView and overwriting "otherMouseDown:" and in this
method creating a new NSEvent-Object with for NSLeftMouseDown event
and special modifier Flags and passing this to the mouseDown: method.
This didn't work, because WebView doesn't use mouseDown at all, so
calling "mouseDown:" on a WebView does nothing.
I tried to call "[NSApp postEvent:event atStart:YES|NO]", "[NSApp
sendEvent:event]" and "[NSWindow sendEvent:event]" instead from
"otherMouseDown:", but this didn't work either.
2) I checked for the otherMouseDown/otherMouseUp event from within the
delegate method "webView:mouseDidMoveOverElement:modifierFlags:", but
while this method gets called for mouseMove events and leftMouseUp
events, it will never called for "otherMouse" events.
So how can I pass mouseEvents to WebView, or alternativly, how can
WebView be forced to react on a click with the third/middle mouse
button?
--
Alexander


|