summaryrefslogtreecommitdiffstats
path: root/video/out/w32_common.c
diff options
context:
space:
mode:
authornanahi <130121847+na-na-hi@users.noreply.github.com>2023-12-17 16:08:53 -0500
committerDudemanguy <random342@airmail.cc>2024-01-15 16:06:06 +0000
commit9267600792247fe1147345c27b204c3c9f3e86bc (patch)
treeaa65e0aeed5e977c81bd7f50b4f307528f354fba /video/out/w32_common.c
parent758a9658d6d64573e9e7da24ba2f7b2509d84a7e (diff)
downloadmpv-9267600792247fe1147345c27b204c3c9f3e86bc.tar.bz2
mpv-9267600792247fe1147345c27b204c3c9f3e86bc.tar.xz
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.
Diffstat (limited to 'video/out/w32_common.c')
-rw-r--r--video/out/w32_common.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/video/out/w32_common.c b/video/out/w32_common.c
index 17a6a7ba9d..60452788eb 100644
--- a/video/out/w32_common.c
+++ b/video/out/w32_common.c
@@ -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);