mouseDown: not firing in WebView subclass

前端 未结 3 1578
春和景丽
春和景丽 2020-12-18 10:40

I think this should be quite simple, but I cannot make it work.

I want to detect mouse clicks on a WebView...

I\'ve subclassed WebView, here

3条回答
  •  -上瘾入骨i
    2020-12-18 11:12

    The problem is that the message isn't being sent to the WebView. Instead it is being sent to the private WebHTMLView inside your WebView, which actually processes the mouse events.

    http://trac.webkit.org/browser/trunk/Source/WebKit/mac/WebView/WebHTMLView.mm#L3555

    You might just want to look into using javascript in your WebView to send the onmousedown events back to your objective-c class.

提交回复
热议问题