TAB map content centred again; key bindings no longer pass on Ctrl/Alt
- megamap: the zoomed view (0x6cc950) is shared by the large map and the TAB overview map; its centre is now set per call from the drawing window's offset (hud::DrawOffsetX) instead of fixed to the render width - input: drop the Ctrl/Alt pass-through; GetKeyState reports Alt as held after Alt+Tab, which switched all bindings back to the game's handling Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
037fc73158
commit
e914bd1590
4 files changed
+50
-14
No files matched your search
+5
-7
@@ -10,8 +10,10 @@
|
||||
// hotkey post that hotkey's key event to the game's event kernel, the way the window
|
||||
// procedure does (the kernel dispatches it right away, on the window thread).
|
||||
//
|
||||
// While a text field has the keyboard, or Ctrl / Alt is held, keys pass
|
||||
// through unchanged.
|
||||
// While a text field has the keyboard, keys pass through unchanged. (Keys
|
||||
// with Ctrl / Alt held used to pass too; GetKeyState reports Alt as held after
|
||||
// Alt+Tab until it is pressed again in the game, which switched the bindings
|
||||
// off. Alt+key arrives as WM_SYSKEYDOWN and is not handled here anyway.)
|
||||
//
|
||||
// sacred_re.ini (key names: A-Z, 0-9, F1-F24, Space, None):
|
||||
// [keys]
|
||||
@@ -173,10 +175,6 @@ void Release(const Binding& binding, int vk) {
|
||||
}
|
||||
}
|
||||
|
||||
bool ModifierHeld() {
|
||||
return (GetKeyState(VK_CONTROL) & 0x8000) != 0 || (GetKeyState(VK_MENU) & 0x8000) != 0;
|
||||
}
|
||||
|
||||
// Virtual keys whose WM_KEYDOWN was taken: their WM_CHAR / WM_KEYUP are
|
||||
// swallowed too, even if the state changed in between.
|
||||
bool g_taken[256] = {};
|
||||
@@ -212,7 +210,7 @@ bool HandleWindowMessage(HWND, UINT message, WPARAM wParam, LPARAM lParam) {
|
||||
const bool repeat = (lParam & (1 << 30)) != 0;
|
||||
if (!repeat) {
|
||||
g_taken[vk] = false;
|
||||
if (ModifierHeld() || TypingIntoTextField()) {
|
||||
if (TypingIntoTextField()) {
|
||||
return false;
|
||||
}
|
||||
const Binding* binding = BindingFor(vk);
|
||||
|
||||
Reference in new issue
Block a user