Commit Graph

11 Commits

Author SHA1 Message Date
nanahi 79068baf43 win32: properly handle WM_XBUTTONUP and WM_XBUTTONDOWN
According to MS documentation, an application should return TRUE from
WM_XBUTTONUP and WM_XBUTTONDOWN if it processes these messages.
DefWindowProc generates the WM_APPCOMMAND message when it processes the
WM_XBUTTONUP message, so if an application properly handles WM_XBUTTONUP
messages, extra WM_APPCOMMAND messages won't be generated.

Because mpv doesn't properly handle these messages,
WM_XBUTTONUP causes APPCOMMAND_BROWSER_BACKWARD to be generated, resulting
in duplicated keys and improper fix 438ead7a, which prevents the processing
of the appcommand from sources other than mouse clicks.

Fix this by following the documentation, and the back and forward
appcommands can be added.
2023-12-06 11:07:37 +01:00
Kacper Michajłow 438ead7a3d osdep/w32_keyboard: remove duplicated MP_KEY_BACK mapping
MP_MBTN_BACK is already mapped, the appcmd duplicates this.

Fixes: #12768
Fixes: 8301906
2023-11-11 03:34:00 +00:00
Christoph Heinrich 8301906218 input: add missing windows multimedia keys
x11 and wayland had a lot of multimedia keys mapped that were missing
on windows.
Now the only ones they map that windows doesn't are `MP_KEY_WWW`,
`MP_KEY_ZOOMIN` and `MP_KEY_ZOOMOUT`, which apparently don't have any
equivalent ones on windows.
2023-08-27 16:14:27 +00:00
Christoph Heinrich 0c9d8619e8 input: add missing keypad key defines
So far all the keypad keys except for `0` and `,` mapped to the same
MP_KEY_* independent of numlock state, even though different key codes
are received.
Now all the alternative functions map to appropriate MP_KEY_* defines,
with missing ones added.
2023-08-25 15:55:31 +00:00
Thomas Weißschuh 7a7042a4d1 w32: fix typo in F23 mapping 2022-09-03 08:46:42 -04:00
Thomas Weißschuh c5e5fba632 w32: add support for F13-F24 keys
Fixes #10595
2022-09-02 14:05:46 +02:00
James Ross-Gowan 037c7a9279 w32_common: handle media keys
This was attempted before in fc9695e63b, but it was reverted in
1b7ce759b1 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.
2017-08-05 02:38:44 +10:00
wm4 c9696a1b14 w32_common, w32_keyboard: change license to LGPL
All authors agreed.
2017-06-24 12:54:45 +02:00
wm4 1b7ce759b1 Revert "win32: add mappings for some special keys"
This reverts commit fc9695e63b.

Users were complaining that both mpv and something else (what? I don't
know) respond to some multimedia keys, such as volume change.
2015-06-24 15:14:38 +02:00
wm4 fc9695e63b win32: add mappings for some special keys
Untested.
2015-05-12 23:01:32 +02:00
James Ross-Gowan 32c0df1b53 w32: use the w32_common keymap in terminal-win too 2014-01-19 14:42:15 +01:00