diff --git a/dlls/winemac.drv/cocoa_window.h b/dlls/winemac.drv/cocoa_window.h index f037b08a254..b4cc018414f 100644 --- a/dlls/winemac.drv/cocoa_window.h +++ b/dlls/winemac.drv/cocoa_window.h @@ -81,6 +81,8 @@ @interface WineWindow : NSPanel NSTimeInterval lastDockIconSnapshot; + BOOL allowKeyRepeats; + BOOL ignore_windowDeminiaturize; BOOL ignore_windowResize; BOOL fakingClose; diff --git a/dlls/winemac.drv/cocoa_window.m b/dlls/winemac.drv/cocoa_window.m index 118bf3c2c78..af8ebe7cfb9 100644 --- a/dlls/winemac.drv/cocoa_window.m +++ b/dlls/winemac.drv/cocoa_window.m @@ -2424,7 +2424,18 @@ - (void) setRetinaMode:(int)mode /* * ---------- NSResponder method overrides ---------- */ - - (void) keyDown:(NSEvent *)theEvent { [self postKeyEvent:theEvent]; } + - (void) keyDown:(NSEvent *)theEvent + { + if ([theEvent isARepeat]) + { + if (!allowKeyRepeats) + return; + } + else + allowKeyRepeats = YES; + + [self postKeyEvent:theEvent]; + } - (void) flagsChanged:(NSEvent *)theEvent { @@ -2461,6 +2472,9 @@ - (void) flagsChanged:(NSEvent *)theEvent { BOOL pressed = (modifierFlags & modifiers[i].mask) != 0; + if (pressed) + allowKeyRepeats = NO; + if (i == last_changed) lastModifierFlags = modifierFlags; else