-
Notifications
You must be signed in to change notification settings - Fork 0
Helldivers 2
Helldivers 2 目前無法可靠地處理中文輸入法的狀態。進入遊戲時若系統還在中文模式,按鍵會被輸入法攔走,而遊戲內沒有穩定的方式切回英數。
這一頁說明如何用 ImeModePersistence 把這個遊戲固定綁在英文輸入語言上。需要 v0.6.0 或更新版本。
這個遊戲需要以管理員身分執行本工具。 遊戲本身以提權執行,而 UIPI 不讓較低完整性等級的程式讀取較高等級視窗的資訊 —— 包含視窗類別。沒有提權的話,托盤提示的「當前程式」會顯示
(未知),你連要填什麼類別都看不到。這是這類反作弊遊戲的例外。一般程式不需要、也不該提權執行,代價見下方提權的代價。
有兩層障礙,而第二層讓第一層的努力全部失效:
-
遊戲用 raw input。 一般工具靠對視窗發送
WM_INPUTLANGCHANGEREQUEST來切換輸入語言,而這個訊息只有在視窗把它交給DefWindowProc時才有作用。遊戲直接讀鍵盤裝置,不處理它。 -
反作弊阻擋
OpenProcess。 連「前景這個程式是誰」都讀不到 —— 即使以管理員身分執行也一樣。所以任何以「執行檔路徑」為條件的規則永遠不會觸發,切換機制再怎麼改都沒機會執行。
本工具對應這兩層的手段是:用視窗類別識別程式(不需要開啟該 process,但如上所述,讀取提權視窗的類別需要同等或更高的完整性等級),用 TSF 工作階段層級 API 切換(不對遊戲視窗發訊息、不注入、不附加)。
-
從 Releases 安裝 v0.6.0 或更新版本。
-
啟動它,以管理員身分執行(這個遊戲的必要條件,見上)。
-
啟動 Helldivers 2,然後 Alt-Tab 回到桌面。
-
到通知區域找到圖示 —— 時鐘左邊,Windows 11 預設把新圖示收起來,要先點 ⌃ 展開。圖示是藍色圓角方塊裡一個白色的「中」。
-
在圖示上按右鍵 → 程式綁定輸入語言…
-
按 用視窗類別。欄位應該出現:
class:stingray_window -
輸入語言 下拉選單選
英文 (美國),或你想固定的語言。 -
按 新增/更新。清單裡會出現這條規則。
-
回到遊戲。輸入語言會自動切換。
stingray_window 是 Autodesk Stingray 引擎的視窗類別名稱,Helldivers 2 用的就是這個引擎。你不需要自己查 —— 「用視窗類別」按鈕會用你切過來之前那個程式的類別自動填入。
把滑鼠停在托盤圖示上,不要點它。停留不會改變前景視窗;點下去會把前景交給工作列,你就看不到遊戲的狀態了。
提示文字會顯示四行,成功時應該是:
| 行 | 內容 |
|---|---|
| 當前程式 | class:stingray_window |
| 綁定語言 | 英文 (美國) |
| 實際語言 | 英文 (美國) |
| 上次切換嘗試 | TSF session - 已生效 |
「當前程式」顯示 class: 而不是完整路徑是正常的,不是故障 —— 反作弊不讓任何程式讀取它的執行檔路徑,所以工具顯示它唯一能確定的身分。
本工具預設會把你最後選的輸入模式帶到下一個視窗。如果你只想要「遊戲固定英文」而不要這個全域行為,在右鍵選單取消勾選 跨程式維持輸入模式。綁定規則不受影響,仍然照常生效。
| 症狀 | 原因與處理 |
|---|---|
當前程式顯示 class:stingray_window
|
正常。反作弊擋住路徑讀取,類別是可用的身分 |
當前程式顯示 (未知)
|
最可能是本工具沒有提權。以管理員身分重新啟動它。若已提權仍如此,請確認遊戲確實在前景而不是最小化 |
綁定語言顯示 (無規則)
|
規則沒比對到。核對清單裡的鍵值與提示文字顯示的 class: 完全一致 |
| 上次切換嘗試顯示「該程式未理會」 | TSF 沒能切換該視窗。請回報,但不要期待用更強硬的手段解決(見下) |
| 安裝或更新時要求先關閉程式 | 提權執行的必然結果:UIPI 讓非提權的安裝檔無法自動關閉提權的視窗。從托盤選「結束」,安裝完再啟動 |
| 勾了「開機時自動啟動」但沒生效 |
HKCU\Run 無法啟動提權程式。用下面的工作排程器方式 |
以管理員身分執行有三個代價,都是 Windows 的設計而非本工具的缺陷:
| 代價 | 說明 |
|---|---|
| 每次啟動要過 UAC | 提權程式無法從 HKCU\Run 自動啟動 |
| 托盤的「開機時自動啟動」失效 | 同上。改用下面的工作排程器 |
| 安裝/更新時要手動關閉 | 非提權的安裝檔無法對提權視窗發送關閉訊息 |
工作排程器是唯一能在登入時提權啟動又不彈 UAC 的方式:
- 開啟工作排程器 → 建立工作(不是「建立基本工作」)
- 一般頁籤:命名,勾選以最高權限執行
- 觸發程序頁籤 → 新增 → 開始工作:登入時
-
動作頁籤 → 新增 → 啟動程式 → 選
%LocalAppData%\Programs\ImeModePersistence\ImeModePersistence.exe - 設定頁籤:取消勾選如果工作執行超過下列時間,就停止工作
設定完之後請取消托盤選單的「開機時自動啟動」 —— 兩者並存會讓一個非提權的副本也嘗試啟動,它會因為單一實例鎖而立刻結束,但誰先啟動並不保證。
- 不注入遊戲 process、不附加到它的輸入佇列、不讀寫它的記憶體
- 切換走的是 TSF 的公開 API,由作業系統去改輸入語言
- 若仍然無法生效,約 930 ms 後安靜放棄,不會加大力道
理由很直接:上面那些手段正是反作弊存在的目的所要偵測的行為。就算技術上可行,代價可能是你的帳號被誤判封鎖 —— 那遠大於自動切輸入法的便利。
同樣的做法適用於任何讀不到執行檔的程式:把 stingray_window 換成該遊戲的視窗類別即可,而「用視窗類別」按鈕會自動填入。用同一個引擎的遊戲類別名可能相同。
Helldivers 2 does not reliably handle IME state. If the system is in Chinese mode when you enter the game, keystrokes are intercepted by the IME and there is no dependable in-game way back to alphanumeric.
Two barriers, and the second makes the first irrelevant:
-
The game reads raw input, so
WM_INPUTLANGCHANGEREQUEST— how ordinary tools switch a window's input language — does nothing. -
Anti-cheat refuses
OpenProcess, even to an administrator, so the foreground application cannot be identified by path and any rule keyed on one never fires.
ImeModePersistence answers both: it identifies the window by class and switches through TSF's session-level API (no message to the game's window, no injection, no attachment).
This game requires running the utility as administrator. The game itself is elevated, and UIPI does not let a lower integrity level process read information about a higher one's windows — including the window class. Without elevation the app line reads
(unknown)and you cannot even see which class to enter. This is the exception for anti-cheat games; ordinary applications neither need nor should have it.
- Install v0.6.0 or newer from Releases and run it as administrator (required for this game — see above).
- Start Helldivers 2, then Alt-Tab back to the desktop.
- Right-click the tray icon (Windows 11 hides new icons behind the ⌃ chevron) → App language bindings...
- Press Use window class. The field should fill with
class:stingray_window. - Choose
English (United States)under Language, then press Add / update. - Return to the game.
stingray_window is the Autodesk Stingray engine's window class. You do not need to look it up — the button fills it in.
Hover the tray icon; do not click it. Hovering does not change the foreground window, whereas clicking hands it to the taskbar and you lose the reading you wanted. On success:
| Line | Value |
|---|---|
| App | class:stingray_window |
| Bound language | English (United States) |
| Active language | English (United States) |
| Last switch attempt | TSF session - took effect |
class: rather than a path is expected, not a fault: anti-cheat blocks reading the executable, so the utility reports the identity it could establish.
Three costs, all Windows design rather than defects here: a UAC prompt at every start, the tray's Start with Windows no longer working (HKCU\Run cannot launch an elevated program), and setup asking you to close the utility by hand when updating (UIPI blocks the unelevated installer from closing an elevated window).
For elevated autostart, use Task Scheduler: Create Task, tick Run with highest privileges, trigger At log on, action pointing at %LocalAppData%\Programs\ImeModePersistence\ImeModePersistence.exe. Then untick the tray's Start with Windows, or an unelevated copy will also try to start.
Uncheck Keep mode across windows in the tray menu. Bindings keep working.
Nothing is injected into the game, attached to its input queue, or read from its memory; switching goes through TSF's public API; and where that fails the utility gives up quietly after ~930 ms. Those techniques are what anti-cheat exists to detect, and a false positive costs you the account — which is worse than switching the language by hand.
ImeModePersistence · 下載 / Releases · 問題回報 / Issues · README · 設計筆記 / Design notes · MIT
本 Wiki 是操作說明;實作理由與被否決的做法記在設計筆記。發佈的檔案未經簽章。 This wiki is the how-to; implementation reasoning and rejected approaches live in the design notes. Released files are unsigned.
繁體中文
English
简体中文
日本語
한국어