Input: keep the input method out of the title's windows (VICTORY_IME_OFF, on by default) #4105
No reviewers
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
good first issue
help wanted
input
INTEL
invalid
lighting
linux-proton
memory
needs-info
needs-logs
needs-rebase
NVIDIA
performance
pr-diagnostics
pr-docs
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
rendering
report
series-s
shaders
spam
startup
upstream
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/trustno1-coder--VIctory-NVIDIA!4105
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-4105"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@kongmuqiu on GitHub · 2026-11-30 16:06 UTC · original
kongmuqiu:ime-off-pr→main· +352 −8 · 9 files · 4 commits · openFixes # (no open issue found for it; seen here with Microsoft Pinyin)
What it changes
What was wrong: with a Chinese, Japanese or Korean input method on, W, A, S and D start a composition in the game's window. The candidate box shows at the window's top left and the keys go to it, so the player has to switch the input method to English before every session.
VICTORY_IME_ENGLISH=1(#17, opt-in) switches the keyboard layout to en-US when that layout is installed, but it does not keep the input method out of the window, and it does nothing on a PC without the en-US layout.What this does: games detach the input method from their windows, and this does the same. It is on by default;
VICTORY_IME_OFF=0, or INPUT METHOD in the F1 menu, keeps the input method.ImmAssociateContextExwith no context). It is detached again when activated, focused, or when the input language changes (WM_INPUTLANGCHANGE, Win+Space).ImmNotifyIME CPS_CANCEL), as SDL and Chromium do.WM_IME_SETCONTEXTreaches the title with every UI flag cleared.WM_IME_START/COMPOSITION/ENDCOMPOSITION. This happens at most 256 times, so an overlay is never fought for good.VICTORY_IME_OFF=threadalso disables the input method for the window's thread (ImmDisableIME(0)before its first top-level window). It is for input methods or remote sessions where a per-window detach does not hold. The fallback presenter window's thread gets no input method either.dialog::choose) counts the same way, through one guard (DialogUp), so the Enter that answers it no longer also presses A.VICTORY_MNK=1, the native mouse camera's overlay treats such a dialog as a menu: the cursor is let go, and the mouse buttons no longer press the pad's triggers.VICTORY_IME_ENGLISH; both can be on.It follows what SDL3, Godot, Chromium and Qt do, the DirectX article on using an input method editor in a game, and the Microsoft Pinyin report in SDL PR #15052 (Pinyin ignores cleared
WM_IME_SETCONTEXTflags).How it was tested
GPU and profile: RTX 4070 Laptop 8 GB, Windows 11 26300, Microsoft Pinyin. Series S, 1920x1080 output, with and without DLSS, no frame generation, ray tracing on. The change does not depend on the GPU or the profile.
Before: W showed Pinyin's candidate window at the window's top left in Chinese mode.
After: no candidate window in Chinese or English mode, also after switching the input language away and back and after Alt+Tab, and the character walks. The text entry dialog is not detached, so it should keep Pinyin, but that was not tried in game.
For shader changes, the wave sizes tested: no shader changes.
cargo testpassed for the crates it touches: yes forvictory-hle(lifecycle,xgameui,mnk,gameinput: 126 passed, 0 failed). Three of the tests are new:WM_IME_SETCONTEXT;VICTORY_IME_OFF=threadleaves new windows without a default IME window.The F1 menu no longer has unit tests since its rewrite (
3bde4923); its new item has a description line within the 60 columns. Rebased onto5fabb46e: the release build passes, andcargo clippy -p victory-gpu -p victory-hle --all-targetsadds no warning.Checked for overlap
menu.rs).Follow-up: #4260 builds on this PR. It adds opt-in GTA PC controls and a smoothed mouse camera (
VICTORY_KBM_GTA=1), which use this PR's dialog guard. This PR stands on its own and can be merged without it.🤖 Generated with Claude Code
github-bot referenced this pull request2026-11-30 16:51:58 +00:00
77aef795d8tofe67c1d39cView command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.