mirror of
https://github.com/valentderah/totk-pc-recomp.git
synced 2026-11-21 12:55:57 +00:00
Merge pull request #193: Detach the game window from the input method (shenjackyuanjie)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
commit
1681ad1bd6
2 files changed
+8
-2
No files matched your search
@@ -20,6 +20,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <windows.h>
|
||||
#include <imm.h>
|
||||
|
||||
#include "cfg.h"
|
||||
#include "flight.h"
|
||||
@@ -484,6 +485,11 @@ static DWORD WINAPI window_main(void *arg) {
|
||||
rt_log("gfx: CreateWindowEx failed (%lu)", GetLastError());
|
||||
g_wnd_failed = 1;
|
||||
} else {
|
||||
// An IME switched on over the game attaches to this window and then shows its candidate window and eats the keys
|
||||
// it composes, although there is nothing here to type into (Shift, which a player may have bound as the walk key,
|
||||
// is one of the keys a Chinese IME takes). Detaching the game's window leaves the software keyboard alone: its
|
||||
// edit box is a window of its own and gets the IME it needs.
|
||||
ImmAssociateContext(g_hwnd, NULL);
|
||||
// The frame was measured at the system DPI; the window may have opened on a monitor at another scale.
|
||||
InterlockedExchange(&g_dpi, (LONG)GetDpiForWindow(g_hwnd));
|
||||
outer_size(g_hwnd, cw, ch, &ow, &oh);
|
||||
|
||||
Reference in new issue
Block a user