Welcome to MacForumz.com!
FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Sending mouseclicks to WebView-Objects

 
   Macintosh computer (Home) -> General Discussion RSS
Next:  Boot Camp Installation problem  
Author Message
Alexander Clauss

External


Since: Apr 06, 2004
Posts: 25



(Msg. 1) Posted: Mon Sep 17, 2007 1:39 pm
Post subject: Sending mouseclicks to WebView-Objects
Archived from groups: comp>sys>mac>programmer>misc (more info?)

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

 >> Stay informed about: Sending mouseclicks to WebView-Objects 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Autoreleased objects, no event loop - What's a good way of dealing with Cocoa objects that are implcitly autoreleased, when you know there's no event loop coming to clean them up? Like in a Foundation tool. The specific situation is more or less as follows. In this code, an autorelease...

NIB objects don't receive dealloc message - After monitoring a NIB loaded view class that I created, I noticed that its retain count never drops below 2, even when the program shuts down. This prevents the object from ever receiving a dealloc message. Does this mean that this NIB based view neve...

modify OS X keyboard mappings - Hello, I need to have access to the french characters. I can do this with the Canadian - CSA keyboard. However, that keyboard has a "," as a decimal. I need a ".". Changing it in the international control panel does not change...

Shared memory - Hello all, If you're not on the beach maybe you can give me a little help. I need to implement shared memory between my application and a helper tool. At first I tried CFMessageProts. This works, but if you transport huge amounts of data the data get al...

mouse freeze - My mouse has started to freeze on booting (OS 9.03). The problem is intermittent, after touching the mouse it sometimes moves just slightly and freezes again. Can someone help? Boris vainerb@access4less.net
   Macintosh computer (Home) -> General Discussion All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]