Skip to content

Add option to restrict cycle hotkeys to focused EVE windows - #136

Open
mr-moon wants to merge 1 commit into
Proopai:unified-source-buildfrom
mr-moon:feature/conditional-cycle-hotkeys
Open

Add option to restrict cycle hotkeys to focused EVE windows#136
mr-moon wants to merge 1 commit into
Proopai:unified-source-buildfrom
mr-moon:feature/conditional-cycle-hotkeys

Conversation

@mr-moon

@mr-moon mr-moon commented Jun 22, 2026

Copy link
Copy Markdown

Summary

Cycle-group and "Minimize All Clients" hotkeys were registered as system-wide global hotkeys (RegisterHotKey). They fired in
every application and swallowed the key combo even when no EVE window was focused, so the key's native action could never run.
This PR adds an opt-in option so those hotkeys only act while an EVE client window or an EVE-O-Preview window is focused;
otherwise the key passes through to its native action. Default is off, preserving current behavior.

Changes

  • Low-level keyboard hook: cycle/minimize hotkeys now go through a single WH_KEYBOARD_LL hook instead of RegisterHotKey, so
    each press can be suppressed (handled) or passed through (CallNextHookEx). Exact modifier matching; cycling work dispatched
    async so the callback never trips the OS hook timeout.
  • Conditional gate: when enabled, handling is gated on the foreground window being an EVE client (or its thumbnail) or the
    EVE-O-Preview window, reusing IsClientWindowActive / IsMainWindowActive. Flag is read live, so toggling applies without
    restart.
  • Reliable activation: bringing the target window forward uses AttachThreadInput to lift the foreground lock for
    SetForegroundWindow. RegisterHotKey granted this implicitly; a low-level hook does not, so without it the next client would
    highlight then immediately revert.
  • Config + UI: new RestrictCycleHotkeysToActiveClients setting (default false) with a "Cycle hotkeys only when an EVE window is
    focused" checkbox on the General tab, following the existing HideThumbnailsOnLostFocus pattern.

Scope

Only cycle-group and Minimize-All hotkeys are affected. Per-character jump hotkeys are unchanged.

@mr-moon
mr-moon force-pushed the feature/conditional-cycle-hotkeys branch 3 times, most recently from 8de3c7a to cb492b7 Compare June 23, 2026 18:22
…VE clients

Cycle-group and Minimize-All hotkeys were registered as global hotkeys
(RegisterHotKey), so they fired everywhere and swallowed the key even when no
EVE window was focused. This adds an opt-in option to only act on those hotkeys
while an EVE client or an EVE-O-Preview window is focused, passing the key
through to its native action otherwise.

- Keep activating clients through RegisterHotKey (HotkeyHandler): its WM_HOTKEY
  message implicitly grants this process the right to change the foreground
  window, so a plain SetForegroundWindow stays fast and reliable. (A low-level
  keyboard hook does not get this grant, which caused windows to fail to focus,
  intermittent lag, stuck highlight borders, and broken cycling after Alt-Tab.)
- Achieve conditional pass-through by registering / unregistering the cycle /
  minimize hotkeys as the foreground window changes, via a SetWinEventHook
  watcher (ForegroundWindowWatcher). Unregistered hotkeys pass through to their
  native action; gating is instant on focus change with a refresh-timer backstop
  so a runtime toggle takes effect without a restart.
- Add RestrictCycleHotkeysToActiveClients config + General-tab checkbox.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@mr-moon
mr-moon force-pushed the feature/conditional-cycle-hotkeys branch from cb492b7 to 0277fc6 Compare June 24, 2026 10:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant