From 4818ea9d9d93722786a829df4b44e3f782824dde Mon Sep 17 00:00:00 2001 From: David Robillard Date: Mon, 30 Apr 2012 20:46:25 +0000 Subject: Implement key repeat ignore on OSX. --- pugl/pugl_osx.m | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pugl/pugl_osx.m b/pugl/pugl_osx.m index 5ac2e30..2a534b3 100644 --- a/pugl/pugl_osx.m +++ b/pugl/pugl_osx.m @@ -186,8 +186,8 @@ getModifiers(unsigned modifierFlags) - (void) keyDown:(NSEvent*)event { - if (view->keyboardFunc) { - NSString* chars = [event characters];; + if (view->keyboardFunc && !(view->ignoreKeyRepeat && [event isARepeat])) { + NSString* chars = [event characters]; view->mods = getModifiers([event modifierFlags]); view->keyboardFunc(view, true, [chars characterAtIndex:0]); } @@ -196,7 +196,7 @@ getModifiers(unsigned modifierFlags) - (void) keyUp:(NSEvent*)event { if (view->keyboardFunc) { - NSString* chars = [event characters];; + NSString* chars = [event characters]; view->mods = getModifiers([event modifierFlags]); view->keyboardFunc(view, false, [chars characterAtIndex:0]); } -- cgit v1.2.1