diff options
author | Uoti Urpala <uau@glyph.nonexistent.invalid> | 2010-12-20 19:17:43 +0200 |
---|---|---|
committer | Uoti Urpala <uau@glyph.nonexistent.invalid> | 2010-12-20 19:17:43 +0200 |
commit | 0afb326035e66663a90c4609f21560ce772e9718 (patch) | |
tree | 07f443e2bd39745ac7430cff9534529958be9c53 /libvo/x11_common.c | |
parent | 4a26b4c024498c9b1be4723121d86e0c2b386ed2 (diff) | |
parent | 5bb2f9787f557bd91d5eb9021238ed7b131d5fa9 (diff) | |
download | mpv-0afb326035e66663a90c4609f21560ce772e9718.tar.bz2 mpv-0afb326035e66663a90c4609f21560ce772e9718.tar.xz |
Merge branch 'hr-seek'
* hr-seek:
input: add default keybindings Shift+[arrow] for small exact seeks
input: support bindings with modifier keys for X input
core: audio: make ogg missing audio timing workaround more complex
core: add support for precise non-keyframe-limited seeks
core: add struct for queued seek info
commands: add generic option -> property wrapper
options: add "choice" option type, use for -pts-association-mode
core: remove looping in update_video(), modify command handling a bit
core: seek: use accurate seek mode with audio-only files
core: avoid using sh_video->pts as "current pts"
libvo: register X11 connection fd in input event system
core: timing: add special handling of long frame intervals
core: move central play loop to a separate function
Conflicts:
DOCS/tech/slave.txt
Diffstat (limited to 'libvo/x11_common.c')
-rw-r--r-- | libvo/x11_common.c | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/libvo/x11_common.c b/libvo/x11_common.c index 655b1c69d0..596645662c 100644 --- a/libvo/x11_common.c +++ b/libvo/x11_common.c @@ -540,12 +540,12 @@ static const struct mp_keymap keysym_map[] = { {0, 0} }; -static void vo_x11_putkey_ext(struct vo *vo, int keysym) +static void vo_x11_putkey_ext(struct vo *vo, int keysym, int modifiers) { struct mp_fifo *f = vo->key_fifo; int mpkey = lookup_keymap_table(keysym_map, keysym); if (mpkey) - mplayer_put_key(f, mpkey); + mplayer_put_key(f, mpkey + modifiers); } #endif @@ -584,7 +584,7 @@ static const struct mp_keymap keymap[] = { {0, 0} }; -void vo_x11_putkey(struct vo *vo, int key) +static void vo_x11_putkey(struct vo *vo, int key, int modifiers) { static const char *passthrough_keys = " -+*/<>`~!@#$%^&()_{}:;\"\',.?\\|=[]"; int mpkey = 0; @@ -598,7 +598,7 @@ void vo_x11_putkey(struct vo *vo, int key) mpkey = lookup_keymap_table(keymap, key); if (mpkey) - mplayer_put_key(vo->key_fifo, mpkey); + mplayer_put_key(vo->key_fifo, mpkey + modifiers); } @@ -814,13 +814,22 @@ int vo_x11_check_events(struct vo *vo) XLookupString(&Event.xkey, buf, sizeof(buf), &keySym, &x11->compose_status); + int modifiers = 0; + if (Event.xkey.state & ShiftMask) + modifiers |= KEY_MODIFIER_SHIFT; + if (Event.xkey.state & ControlMask) + modifiers |= KEY_MODIFIER_CTRL; + if (Event.xkey.state & Mod1Mask) + modifiers |= KEY_MODIFIER_ALT; + if (Event.xkey.state & Mod4Mask) + modifiers |= KEY_MODIFIER_META; #ifdef XF86XK_AudioPause - vo_x11_putkey_ext(vo, keySym); + vo_x11_putkey_ext(vo, keySym, modifiers); #endif key = ((keySym & 0xff00) != 0 ? ((keySym & 0x00ff) + 256) : (keySym)); - vo_x11_putkey(vo, key); + vo_x11_putkey(vo, key, modifiers); ret |= VO_EVENT_KEYPRESS; } break; @@ -1123,6 +1132,7 @@ final: x11->vo_gc = XCreateGC(mDisplay, x11->window, GCForeground, &xgcv); XSync(mDisplay, False); x11->vo_mouse_autohide = 1; + vo->event_fd = ConnectionNumber(x11->display); } void vo_x11_clearwindow_part(struct vo *vo, Window vo_window, |