Plugins/WebKit Message View/ESWebView.m
changeset 2723 6fa58273701e
parent 2185 9d8345ab2d12
     1.1 --- a/Plugins/WebKit Message View/ESWebView.m	Thu May 14 13:46:57 2009 -0700
     1.2 +++ b/Plugins/WebKit Message View/ESWebView.m	Sun Nov 01 11:15:19 2009 -0500
     1.3 @@ -93,9 +93,22 @@
     1.4  //into this view.
     1.5  - (void)keyDown:(NSEvent *)theEvent
     1.6  {
     1.7 +	BOOL forwarded = YES;
     1.8 +	
     1.9  	if (shouldForwardEvents) {
    1.10 -		[self forwardSelector:@selector(keyDown:) withObject:theEvent];
    1.11 -	} else {
    1.12 +		unichar		 inChar = [[theEvent charactersIgnoringModifiers] characterAtIndex:0];
    1.13 +		
    1.14 +		// Don't forward navigation key events. If we're receiving them, it's because
    1.15 +		// the frame itself didn't support them.
    1.16 +		if (inChar != NSUpArrowFunctionKey && inChar != NSDownArrowFunctionKey &&
    1.17 +			inChar != NSPageUpFunctionKey && inChar != NSPageDownFunctionKey)
    1.18 +		{
    1.19 +			[self forwardSelector:@selector(keyDown:) withObject:theEvent];
    1.20 +			forwarded = YES;
    1.21 +		}
    1.22 +	}
    1.23 +	
    1.24 +	if (!forwarded) {
    1.25  		[super keyDown:theEvent];
    1.26  	}
    1.27  }