• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Keyboard Events and WebView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Keyboard Events and WebView


  • Subject: Keyboard Events and WebView
  • From: Robert Walker <email@hidden>
  • Date: Tue, 23 May 2006 09:34:12 -0400

Hello All,

I am having trouble figuring out how to capture keyboard events with keyDown when using a WebView as the content view of a window.

I'll try to explain why I need this: I have a window that I want to alternately swap the content view between an NSOpenGLView and a WebView as the user presses the space bar. I used a design similar to the example shown in "NSOpenGL Fullscreen" to handle the keyDown event. Basically, I override keyDown in my OpenGLView subclass and forward the event to my controller class. This works fine for the NSOpenGLView.

When the space bar is pressed the window content is swapped with my WebView. At this point I loose control of the keyDown event. It appears that the WebView is "hiding" or somehow capturing the keyDown event. I attempted to subclass the WebView and override the keyDown event, however, the keyDown event is never sent to my subclass.

I realize that the spacebar is used to scroll the WebView's content. I was hoping to override that behavior by subclassing WebView. Apparently that is not possible.

What alternatives do I have? Can I prevent the WebView from becoming the first responder and handle the events at a higher level? Any ideas would be helpful.
--
Robert Walker
email@hidden




_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Prev by Date: Re: NSTokenField - token menu problem
  • Next by Date: Re: Re: KVO question
  • Previous by thread: Does nobody have a fix for the Core recipes sample?
  • Next by thread: generating the event
  • Index(es):
    • Date
    • Thread