Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Mac > Mac Programmer > Sending mousecl...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 1 Topic 967 of 1025
Post > Topic >>

Sending mouseclicks to WebView-Objects

by aclauss@[EMAIL PROTECTED] (Alexander Clauss) Sep 17, 2007 at 07:04 PM

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




 1 Posts in Topic:
Sending mouseclicks to WebView-Objects
aclauss@[EMAIL PROTECTED]  2007-09-17 19:04:22 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Jul 4 16:50:01 CDT 2008.