Member Since: May 06, 2010
05-06-2010, 10:17 AM
I'm new in the apple developer community.
I'm trying to make an application which open a webview in fullscreen mode and hide cursor, menu bar and dock bar.
To do this, i create an nswindow and a webview and add it to the nswindow by using the addsubview function.
This is working great but webview seems to miss all keyboard events. The mouse events are correctly catched by the view. I don't know what's wrong in my code:
// compute the max frame rect
NSRect fullScreenRect = NSZeroRect;
for (NSScreen * screen in [NSScreen screens])
fullScreenRect = NSUnionRect(fullScreenRect, [screen frame]);
// Create a borderless window with the right frame
NSWindow * aWindow = [[NSWindow alloc] initWithContentRect:fullScreenRect styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:NO];
// Set the correct bounds to subview
[_myWebView setFrame:[[aWindow contentView] bounds]];
[[aWindow contentView] addSubview:_myWebView];
[[WebPreferences standardPreferences] setPlugInsEnabled:YES];
// Set default URL
// Move and hide the mouse
// Mask menu bar and dock
Thanks in advance for your help