vo_corevideo: support modifier keys in keyboard input

This commit is contained in:
Stefano Pigozzi 2011-03-03 13:27:30 +02:00 committed by Uoti Urpala
parent afef26425d
commit cf664986ae
1 changed files with 11 additions and 2 deletions

View File

@ -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);
}
}
/*