From cf664986ae9d417103f044a81545dce9c660999f Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Thu, 3 Mar 2011 13:27:30 +0200 Subject: [PATCH] vo_corevideo: support modifier keys in keyboard input --- libvo/vo_corevideo.m | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/libvo/vo_corevideo.m b/libvo/vo_corevideo.m index a964de7e57..1effb449f3 100644 --- a/libvo/vo_corevideo.m +++ b/libvo/vo_corevideo.m @@ -935,8 +935,17 @@ static int control(uint32_t request, void *data) - (void) keyDown: (NSEvent *) theEvent { int key = convert_key([theEvent keyCode], *[[theEvent characters] UTF8String]); - if (key != -1) - mplayer_put_key(key); + if (key != -1) { + if([theEvent modifierFlags] & NSShiftKeyMask) + key |= KEY_MODIFIER_SHIFT; + if([theEvent modifierFlags] & NSControlKeyMask) + key |= KEY_MODIFIER_CTRL; + if([theEvent modifierFlags] & NSAlternateKeyMask) + key |= KEY_MODIFIER_ALT; + if([theEvent modifierFlags] & NSCommandKeyMask) + key |= KEY_MODIFIER_META; + mplayer_put_key(key); + } } /* -- 2.11.4.GIT