Revert "winemac: Dispatch key events directly to window to be sure to get key-up events.".

This reverts commit 0d20ac02f7.
This commit is contained in:
Ken Thomases 2013-07-09 02:49:55 -05:00 committed by Alexandre Julliard
parent 4f23821f08
commit a723af61ac
3 changed files with 14 additions and 9 deletions

View File

@ -1692,12 +1692,6 @@ - (BOOL) handleEvent:(NSEvent*)anEvent
[self handleScrollWheel:anEvent];
ret = mouseCaptureWindow != nil;
}
else if (type == NSKeyDown || type == NSKeyUp)
{
WineWindow* window = (WineWindow*)[anEvent window];
if ([window isKindOfClass:[WineWindow class]])
[window postKeyEvent:anEvent];
}
return ret;
}

View File

@ -68,6 +68,4 @@ @interface WineWindow : NSPanel <NSWindowDelegate>
- (NSInteger) minimumLevelForActive:(BOOL)active;
- (void) updateFullscreen;
- (void) postKeyEvent:(NSEvent *)theEvent;
@end

View File

@ -1195,6 +1195,18 @@ - (void) makeKeyAndOrderFront:(id)sender
}
}
- (void) sendEvent:(NSEvent*)event
{
/* NSWindow consumes certain key-down events as part of Cocoa's keyboard
interface control. For example, Control-Tab switches focus among
views. We want to bypass that feature, so directly route key-down
events to -keyDown:. */
if ([event type] == NSKeyDown)
[[self firstResponder] keyDown:event];
else
[super sendEvent:event];
}
// We normally use the generic/calibrated RGB color space for the window,
// rather than the device color space, to avoid expensive color conversion
// which slows down drawing. However, for windows displaying OpenGL, having
@ -1230,7 +1242,8 @@ - (void) updateColorSpace
/*
* ---------- NSResponder method overrides ----------
*/
- (void) keyDown:(NSEvent *)theEvent { /* Need an implementation to avoid beeps */ }
- (void) keyDown:(NSEvent *)theEvent { [self postKeyEvent:theEvent]; }
- (void) keyUp:(NSEvent *)theEvent { [self postKeyEvent:theEvent]; }
- (void) flagsChanged:(NSEvent *)theEvent
{