0
0
mirror of https://github.com/mpv-player/mpv.git synced 2024-09-20 12:02:23 +02:00

win32: change to alphanumeric mode on the first keypress

Needed in case the timer solution fails. Note that this will leave the
mode indicator in the language bar showing the original mode until
a key is pressed.
This commit is contained in:
nanahi 2023-12-17 16:08:53 -05:00 committed by Dudemanguy
parent 758a9658d6
commit 9267600792

View File

@ -182,6 +182,8 @@ struct vo_w32_state {
bool cleared;
bool dragging;
BOOL win_arranging;
bool conversion_mode_init;
};
static void adjust_window_rect(struct vo_w32_state *w32, HWND hwnd, RECT *rc)
@ -1709,6 +1711,14 @@ static void run_message_loop(struct vo_w32_state *w32)
{
MSG msg;
while (GetMessageW(&msg, 0, 0, 0) > 0) {
// Change the conversion mode on the first keypress, in case the timer
// solution fails. Note that this leaves the mode indicator in the language
// bar showing the original mode until a key is pressed.
if (is_key_message(msg.message) && !w32->conversion_mode_init) {
set_ime_conversion_mode(w32, IME_CMODE_ALPHANUMERIC);
w32->conversion_mode_init = true;
KillTimer(w32->window, (UINT_PTR)WM_CREATE);
}
// Only send IME messages to TranslateMessage
if (is_key_message(msg.message) && msg.wParam == VK_PROCESSKEY)
TranslateMessage(&msg);