Repository navigation
Description
Describe the bug
Sometimes the game acts as if ⌘ and ⇧ are still held down after you've let go, this results in:
- Clicking the map opens the build menu instead of attacking.
- Dragging the map draws a warship selection box instead of moving the map.
The only way out is to press and release ⌘ and ⇧ again.
I've seen this happen before, for example after swiping between fullscreen apps, but I could never reproduce it. Taking a screenshot with ⌘⇧4 on macOS is the first way I've found to trigger it every time.
Screen.Recording.2026-10-25.at.10.15.17.mp4
I reported this on Discord as well: https://discord.com/channels/1284581928254701718/1525106712288297081. Other players there say they've had the same problem on Windows, so it isn't only a Mac bug. I'm on macOS, though, so that's what I've tested.
To Reproduce
- On a Mac, start a game and pick your spawn.
- Press ⌘⇧4 (the macOS screenshot shortcut), then Esc.
- Click the map: the build menu opens.
- Drag the map: a selection box appears and the cursor stays a crosshair.
Expected behavior
Clicking the map without holding ⌘ should attack, and dragging without holding ⇧ should move the map.
When it was introduced
The game has tracked held keys in its own list, activeKeys in src/client/InputHandler.ts, since keyboard pan and zoom were added. A stale entry in that list only became a problem once mouse actions started reading it: Shift+drag warship box-select in #3677 (merged 21 April 2026), then the ⌘+click build menu in #4175 (merged 7 June 2026). Before #4175, the click handler read event.metaKey from the click itself, which always matches the real keyboard.
Why it happens
A key is added to activeKeys on keydown and removed on keyup. The list is also cleared when the window loses focus.
⌘⇧4 opens the macOS screenshot tool, which takes over the keyboard. The page never gets the keyup for ⌘ or ⇧, and the window doesn't lose focus, so both keys stay in the list.
Desktop
- OS: macOS 15.6.1
- Browser: Chrome
- Version: 156.0.8078.47
Smartphone
N/A
Additional context
Discord bug report: https://discord.com/channels/1284581928254701718/1525106712288297081
Assignment
- I'd like to be assigned to this issue and work on it myself
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsTriage
Activity
github-actions commentedon Oct 25, 2026
Hi @francisashley, thanks for opening this issue. It hasn't been approved by a maintainer yet — we'll get back to you shortly to either milestone it (approval) or close it.
— Automated. See CONTRIBUTING.md.
francisashley commentedon Oct 25, 2026
I have come up with a solution here #6124
github-actions commentedon Nov 1, 2026
Hi @francisashley, this issue hasn't had activity in 7 days and doesn't yet have a milestone assigned.
If a maintainer doesn't milestone this issue (or you don't update it) within the next 7 days, it will be automatically closed.
If you believe this issue is important, consider:
keep-openlabel if it should be exempt from auto-close— Automated. See CONTRIBUTING.md.
[-]macOS: ⌘ and ⇧ can get stuck, so clicking opens the build menu and dragging draws a selection box[/-][+]Game thinks ⌘/Ctrl and ⇧ are still held after release[/+]