summaryrefslogtreecommitdiffstats
path: root/video/out
diff options
context:
space:
mode:
authornanahi <130121847+na-na-hi@users.noreply.github.com>2024-03-21 09:16:01 -0400
committersfan5 <sfan5@live.de>2024-03-29 14:07:37 +0100
commit6fed2f8e5816765b6a99a9e3dbf87e4229eb5800 (patch)
tree8daf3a5c51fec5528b305614f84e3ec7d5019645 /video/out
parent3a2a457171e7e79ee0f88a89b6f2bc61f64803c4 (diff)
downloadmpv-6fed2f8e5816765b6a99a9e3dbf87e4229eb5800.tar.bz2
mpv-6fed2f8e5816765b6a99a9e3dbf87e4229eb5800.tar.xz
win32: fix native key repeat support
win32 does not respect --native-keyrepeat option, and native key repeat has been broken since 0ab3482f73a199b2e839ad4ec0a4b21adc1e75d5. This lets mpv respect the --native-keyrepeat option on win32.
Diffstat (limited to 'video/out')
-rw-r--r--video/out/w32_common.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/video/out/w32_common.c b/video/out/w32_common.c
index 50e07ec9a9..66d1fc4701 100644
--- a/video/out/w32_common.c
+++ b/video/out/w32_common.c
@@ -502,10 +502,6 @@ static bool handle_appcommand(struct vo_w32_state *w32, UINT cmd)
static void handle_key_down(struct vo_w32_state *w32, UINT vkey, UINT scancode)
{
- // Ignore key repeat
- if (scancode & KF_REPEAT)
- return;
-
int mpkey = mp_w32_vkey_to_mpkey(vkey, scancode & KF_EXTENDED);
if (!mpkey) {
mpkey = decode_key(w32, vkey, scancode & (0xff | KF_EXTENDED));
@@ -513,7 +509,8 @@ static void handle_key_down(struct vo_w32_state *w32, UINT vkey, UINT scancode)
return;
}
- mp_input_put_key(w32->input_ctx, mpkey | mod_state(w32) | MP_KEY_STATE_DOWN);
+ int state = w32->opts->native_keyrepeat ? 0 : MP_KEY_STATE_DOWN;
+ mp_input_put_key(w32->input_ctx, mpkey | mod_state(w32) | state);
}
static void handle_key_up(struct vo_w32_state *w32, UINT vkey, UINT scancode)