mirror of
https://github.com/mpv-player/mpv
synced 2025-02-24 08:57:00 +00:00
win32: handle WM_UNICHAR
WM_UNICHAR is sent by some 3rd-party IMEs.
This commit is contained in:
parent
33e922eabe
commit
2b1024fa50
@ -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)
|
if (c == 0)
|
||||||
return true;
|
return true;
|
||||||
@ -1446,9 +1446,16 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam,
|
|||||||
break;
|
break;
|
||||||
case WM_CHAR:
|
case WM_CHAR:
|
||||||
case WM_SYSCHAR:
|
case WM_SYSCHAR:
|
||||||
if (handle_char(w32, wParam))
|
if (handle_char(w32, wParam, true))
|
||||||
return 0;
|
return 0;
|
||||||
break;
|
break;
|
||||||
|
case WM_UNICHAR:
|
||||||
|
if (wParam == UNICODE_NOCHAR) {
|
||||||
|
return TRUE;
|
||||||
|
} else if (handle_char(w32, wParam, false)) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
break;
|
||||||
case WM_KILLFOCUS:
|
case WM_KILLFOCUS:
|
||||||
mp_input_put_key(w32->input_ctx, MP_INPUT_RELEASE_ALL);
|
mp_input_put_key(w32->input_ctx, MP_INPUT_RELEASE_ALL);
|
||||||
w32->focused = false;
|
w32->focused = false;
|
||||||
|
Loading…
Reference in New Issue
Block a user