# HG changeset patch # User reimar # Date 1322764458 0 # Node ID 52d927f2b563dd2be9c73e288342138ac90116fe # Parent fcadddee0a5a8fe1bc49a5bca41c8fe29bf10bb9 X11: support CTRL key and thus key combinations with it. diff -r fcadddee0a5a -r 52d927f2b563 libvo/x11_common.c --- a/libvo/x11_common.c Tue Nov 29 20:15:22 2011 +0000 +++ b/libvo/x11_common.c Thu Dec 01 18:34:18 2011 +0000 @@ -844,6 +844,7 @@ ret |= check_resize(); break; case KeyPress: + case KeyRelease: { int key; @@ -853,10 +854,15 @@ XLookupString(&Event.xkey, buf, sizeof(buf), &keySym, &stat); - if (!vo_x11_putkey_ext(keySym)) { - key = - ((keySym & 0xff00) != - 0 ? ((keySym & 0x00ff) + 256) : (keySym)); + key = + ((keySym & 0xff00) != + 0 ? ((keySym & 0x00ff) + 256) : (keySym)); + if (key == wsLeftCtrl || key == wsRightCtrl) { + mplayer_put_key(KEY_CTRL | + (Event.type == KeyPress ? MP_KEY_DOWN : 0)); + } else if (Event.type == KeyRelease) { + break; + } else if (!vo_x11_putkey_ext(keySym)) { vo_x11_putkey(key); } ret |= VO_EVENT_KEYPRESS; @@ -1095,7 +1101,7 @@ // if it relies on events being forwarded to the parent of WinID. // It also is consistent with the w32_common.c code. vo_x11_selectinput_witherr(mDisplay, vo_window, - StructureNotifyMask | KeyPressMask | PointerMotionMask | + StructureNotifyMask | KeyPressMask | KeyReleaseMask | PointerMotionMask | ButtonPressMask | ButtonReleaseMask | ExposureMask); vo_x11_update_geometry(); @@ -1136,7 +1142,7 @@ XSelectInput(mDisplay, vo_window, NoEventMask); XSync(mDisplay, False); vo_x11_selectinput_witherr(mDisplay, vo_window, - StructureNotifyMask | KeyPressMask | PointerMotionMask | + StructureNotifyMask | KeyPressMask | KeyReleaseMask | PointerMotionMask | ButtonPressMask | ButtonReleaseMask | ExposureMask); } if (vo_ontop) vo_x11_setlayer(mDisplay, vo_window, vo_ontop);