diff options
author | James Ross-Gowan <rossy@jrg.systems> | 2017-07-25 23:51:40 +1000 |
---|---|---|
committer | James Ross-Gowan <rossy@jrg.systems> | 2017-08-05 02:38:44 +1000 |
commit | 037c7a92792837642626a120a90fb4ef74f7547e (patch) | |
tree | eee94b18c9c31ee46431be5d33c2d17d33e2c04e /input/input.h | |
parent | e406e814775d0c57797915347a7d27c5cad21011 (diff) | |
download | mpv-037c7a92792837642626a120a90fb4ef74f7547e.tar.bz2 mpv-037c7a92792837642626a120a90fb4ef74f7547e.tar.xz |
w32_common: handle media keys
This was attempted before in fc9695e63b5b, but it was reverted in
1b7ce759b1f4 because it caused conflicts with other software watching
the same keys (See #2041.) It seems like some PCs ship with OEM software
that watches the volume keys without consuming key events and this
causes them to be handled twice, once by mpv and once by the other
software.
In order to prevent conflicts like this, use the WM_APPCOMMAND message
to handle media keys. Returning TRUE from the WM_APPCOMMAND handler
should indicate to the operating system that we consumed the key event
and it should not be propogated to the shell. Also, we now only listen
for keys that are directly related to multimedia playback (eg. the
APPCOMMAND_MEDIA_* keys.) Keys like APPCOMMAND_VOLUME_* are ignored, so
they can be handled by the shell, or by other mixer software.
Diffstat (limited to 'input/input.h')
-rw-r--r-- | input/input.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/input/input.h b/input/input.h index 00f5473f7b..0ea054d21b 100644 --- a/input/input.h +++ b/input/input.h @@ -250,6 +250,9 @@ void mp_input_set_cancel(struct input_ctx *ictx, void (*cb)(void *c), void *c); // characters. If false, count Right Alt as the modifier Alt key. bool mp_input_use_alt_gr(struct input_ctx *ictx); +// Return true if mpv should intercept keyboard media keys +bool mp_input_use_media_keys(struct input_ctx *ictx); + // Like mp_input_parse_cmd_strv, but also run the command. void mp_input_run_cmd(struct input_ctx *ictx, const char **cmd); |