Skip to content

Windows/macOS: Re-register global shortcuts on keyboard layout change#3536

Draft
hluk wants to merge 1 commit into
masterfrom
fix-windows-shortcut-layout
Draft

Windows/macOS: Re-register global shortcuts on keyboard layout change#3536
hluk wants to merge 1 commit into
masterfrom
fix-windows-shortcut-layout

Conversation

@hluk

@hluk hluk commented Apr 6, 2026

Copy link
Copy Markdown
Owner

When the keyboard layout changes, the native keycodes for registered shortcuts may change. Re-register all shortcuts with updated native codes to keep them working.

Windows: Handle WM_INPUTLANGCHANGE message in the native event filter.

macOS: Observe kTISNotifySelectedKeyboardInputSourceChanged via the CF distributed notification center, which is the correct mechanism for detecting input source changes (polling TISCopyCurrentKeyboardInputSource does not work reliably as it requires the event loop to run).

Fixes #1323

Assisted-by: Opus 4.6 (Anthropic)

@codecov

codecov Bot commented Apr 6, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 47.05882% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.05%. Comparing base (a9304ce) to head (919dd91).
⚠️ Report is 40 commits behind head on master.

Files with missing lines Patch % Lines
src/app/clipboardserver.cpp 50.00% 6 Missing ⚠️
qxt/qxtglobalshortcut.cpp 40.00% 3 Missing ⚠️

❌ Your patch check has failed because the patch coverage (47.05%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3536      +/-   ##
==========================================
+ Coverage   81.00%   81.05%   +0.04%     
==========================================
  Files         246      246              
  Lines       31612    31627      +15     
==========================================
+ Hits        25607    25634      +27     
+ Misses       6005     5993      -12     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@hluk hluk force-pushed the fix-windows-shortcut-layout branch 2 times, most recently from 7e1183b to 5891dc8 Compare April 6, 2026 19:32
When the keyboard layout changes, the native keycodes for registered
shortcuts may change. Re-register all shortcuts with updated native
codes to keep them working.

Windows: Handle WM_INPUTLANGCHANGE message in the native event filter.

macOS: Observe kTISNotifySelectedKeyboardInputSourceChanged via the
CF distributed notification center, which is the correct mechanism
for detecting input source changes (polling TISCopyCurrentKeyboardInputSource
does not work reliably as it requires the event loop to run).

Fixes #1323

Assisted-by: Opus 4.6 (Anthropic)
@hluk hluk force-pushed the fix-windows-shortcut-layout branch from 5891dc8 to 919dd91 Compare April 7, 2026 05:52
@hluk hluk marked this pull request as draft April 12, 2026 05:14
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.

Shortcut Ctrl+` not working when launching CopyQ with Czech keyboard on Windows

1 participant