mirror of
https://github.com/mpv-player/mpv
synced 2025-02-06 23:21:54 +00:00
vo_corevideo: support modifier keys in keyboard input
This commit is contained in:
parent
afef26425d
commit
cf664986ae
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user