Skip to content
Snippets Groups Projects
Commit 0d20ac02 authored by Ken Thomases's avatar Ken Thomases Committed by Alexandre Julliard
Browse files

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

For keys pressed in combination with Command, -[NSApplication sendEvent:]
simply doesn't pass the key-up event through to the window.
parent 826bff38
No related branches found
No related tags found
No related merge requests found
......@@ -1692,6 +1692,12 @@ - (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;
}
......
......@@ -68,4 +68,6 @@ @interface WineWindow : NSPanel <NSWindowDelegate>
- (NSInteger) minimumLevelForActive:(BOOL)active;
- (void) updateFullscreen;
- (void) postKeyEvent:(NSEvent *)theEvent;
@end
......@@ -1182,24 +1182,11 @@ - (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];
}
/*
* ---------- NSResponder method overrides ----------
*/
- (void) keyDown:(NSEvent *)theEvent { [self postKeyEvent:theEvent]; }
- (void) keyUp:(NSEvent *)theEvent { [self postKeyEvent:theEvent]; }
- (void) keyDown:(NSEvent *)theEvent { /* Need an implementation to avoid beeps */ }
- (void) flagsChanged:(NSEvent *)theEvent
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment