aboutsummaryrefslogtreecommitdiffstats
path: root/pugl/pugl_osx.m
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-04-30 20:46:25 +0000
committerDavid Robillard <d@drobilla.net>2012-04-30 20:46:25 +0000
commit4818ea9d9d93722786a829df4b44e3f782824dde (patch)
tree54f94fa919c1c29a1774949abcb1ba8745743471 /pugl/pugl_osx.m
parent1365dd607f51217017f6de4c7246626a6fdd07e8 (diff)
downloadpugl-4818ea9d9d93722786a829df4b44e3f782824dde.tar.gz
pugl-4818ea9d9d93722786a829df4b44e3f782824dde.tar.bz2
pugl-4818ea9d9d93722786a829df4b44e3f782824dde.zip
Implement key repeat ignore on OSX.
Diffstat (limited to 'pugl/pugl_osx.m')
-rw-r--r--pugl/pugl_osx.m6
1 files 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]);
}