summaryrefslogtreecommitdiffstats
path: root/libvo/vo_corevideo.m
diff options
context:
space:
mode:
authorStefano Pigozzi <stefano.pigozzi@gmail.com>2011-03-03 13:27:30 +0200
committerUoti Urpala <uau@glyph.nonexistent.invalid>2011-03-03 13:27:30 +0200
commitcf664986ae9d417103f044a81545dce9c660999f (patch)
tree121b9a74efad9977ae065de21b6dcbb304293cbc /libvo/vo_corevideo.m
parentafef26425d41f34079698891ea71f59212bdef2c (diff)
downloadmpv-cf664986ae9d417103f044a81545dce9c660999f.tar.bz2
mpv-cf664986ae9d417103f044a81545dce9c660999f.tar.xz
vo_corevideo: support modifier keys in keyboard input
Diffstat (limited to 'libvo/vo_corevideo.m')
-rw-r--r--libvo/vo_corevideo.m13
1 files 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);
+ }
}
/*