Skip to content

Fix incorrect GetAsyncKeyState usage for modifier key detection#3257

Merged
sdottaka merged 1 commit into
masterfrom
fix/getasynckeystate-check
Mar 15, 2026
Merged

Fix incorrect GetAsyncKeyState usage for modifier key detection#3257
sdottaka merged 1 commit into
masterfrom
fix/getasynckeystate-check

Conversation

@sdottaka

Copy link
Copy Markdown
Member

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes modifier-key detection by updating GetAsyncKeyState checks to correctly test the high-order bit (key currently down), preventing false positives caused by the low-order “pressed since last call” bit.

Changes:

  • Update VK_SHIFT checks from truthiness to GetAsyncKeyState(VK_SHIFT) < 0 in merge-mode key handlers.
  • Update VK_CONTROL checks from truthiness to GetAsyncKeyState(VK_CONTROL) < 0 in merge-mode key handlers.
  • Fix Shift+Delete detection in CSuperComboBox::PreTranslateMessage to only trigger when Shift is actually held.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
Src/WebPageDiffFrm.cpp Corrects Shift/Ctrl detection in web diff merge-mode key handling.
Src/MergeEditView.cpp Corrects Shift/Ctrl detection in editor merge-mode key handling.
Src/ImgMergeFrm.cpp Corrects Shift/Ctrl detection in image merge-mode key handling.
Src/Common/SuperComboBox.cpp Corrects Shift detection for Shift+Delete behavior while dropdown is open.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@sdottaka sdottaka marked this pull request as ready for review March 15, 2026 11:33
@sdottaka sdottaka merged commit 8b833b0 into master Mar 15, 2026
6 of 7 checks passed
@sdottaka sdottaka deleted the fix/getasynckeystate-check branch March 15, 2026 11:34
@sdottaka sdottaka added this to the v2.16.55 milestone Mar 29, 2026
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.

2 participants