diff options
author | nanahi <130121847+na-na-hi@users.noreply.github.com> | 2023-12-15 10:54:30 -0500 |
---|---|---|
committer | Dudemanguy <random342@airmail.cc> | 2024-01-15 16:06:06 +0000 |
commit | 2b1024fa50416feebc13d7ef49dbc19b6a9a0603 (patch) | |
tree | 704bb28c95dabe98b39e62a6371662693168021d /video | |
parent | 33e922eabe4c5227afaf93022aefada63bd21b78 (diff) | |
download | mpv-2b1024fa50416feebc13d7ef49dbc19b6a9a0603.tar.bz2 mpv-2b1024fa50416feebc13d7ef49dbc19b6a9a0603.tar.xz |
win32: handle WM_UNICHAR
WM_UNICHAR is sent by some 3rd-party IMEs.
Diffstat (limited to 'video')
-rw-r--r-- | video/out/w32_common.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/video/out/w32_common.c b/video/out/w32_common.c index ac27303b37..717430bb1f 100644 --- a/video/out/w32_common.c +++ b/video/out/w32_common.c @@ -457,9 +457,9 @@ static void handle_key_up(struct vo_w32_state *w32, UINT vkey, UINT scancode) } } -static bool handle_char(struct vo_w32_state *w32, wchar_t wc) +static bool handle_char(struct vo_w32_state *w32, WPARAM wc, bool decode) { - int c = decode_utf16(w32, wc); + int c = decode ? decode_utf16(w32, wc) : wc; if (c == 0) return true; @@ -1446,9 +1446,16 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, break; case WM_CHAR: case WM_SYSCHAR: - if (handle_char(w32, wParam)) + if (handle_char(w32, wParam, true)) return 0; break; + case WM_UNICHAR: + if (wParam == UNICODE_NOCHAR) { + return TRUE; + } else if (handle_char(w32, wParam, false)) { + return 0; + } + break; case WM_KILLFOCUS: mp_input_put_key(w32->input_ctx, MP_INPUT_RELEASE_ALL); w32->focused = false; |