Skip to content

gh-56596: Make IDLE key bindings work with Caps Lock on - #157709

Merged
terryjreedy merged 6 commits into
python:mainfrom
serhiy-storchaka:gh-56596-capslock
Sep 18, 2026
Merged

terryjreedy merged 6 commits into
python:mainfrom
serhiy-storchaka:gh-56596-capslock

Conversation

@serhiy-storchaka

Copy link
Copy Markdown
Member

Tk does not fold the case of letter keysyms, and Caps Lock changes it: with Caps Lock on, Ctrl+S produces the keysym S, which <Control-Key-s> does not match. EditorWindow.apply_bindings() now also binds each key sequence with the case of its letters swapped, for core and extension bindings on all platforms. The keysets themselves, the Settings dialog and the menu accelerators are unchanged.

An explicit Shift binding such as <Control-Shift-Key-S> is more specific than the added <Control-Key-S>, so it still wins. Supersedes #32245, which did the same in GetCurrentKeySet() but removed a test and duplicated the Windows bindings.

🤖 Generated with Claude Code

Tk does not fold the case of letter keysyms, and Caps Lock changes it,
so bind each key sequence with the other case of its letters too.
Comment thread Misc/NEWS.d/next/IDLE/2026-09-17-23-00-00.gh-issue-56596.capslock.rst Outdated
Comment thread Misc/NEWS.d/next/IDLE/2026-09-17-23-00-00.gh-issue-56596.capslock.rst Outdated

@terryjreedy terryjreedy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Approved with changes.

Comment thread Lib/idlelib/idle_test/test_editor.py Outdated
Comment thread Lib/idlelib/editor.py Outdated
@bedevere-app

bedevere-app Bot commented Sep 18, 2026

Copy link
Copy Markdown

When you're done making the requested changes, leave the comment: I have made the requested changes; please review again.

@terryjreedy
terryjreedy merged commit 0b18efd into python:main Sep 18, 2026
54 of 55 checks passed
@miss-islington-app

Copy link
Copy Markdown

Thanks @serhiy-storchaka for the PR, and @terryjreedy for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14, 3.15.
🐍🍒⛏🤖

@miss-islington-app

Copy link
Copy Markdown

Sorry, @serhiy-storchaka and @terryjreedy, I could not cleanly backport this to 3.15 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker 0b18efdf12c56b7b1f2080aa26c419b0014bde77 3.15

@bedevere-app

bedevere-app Bot commented Sep 18, 2026

Copy link
Copy Markdown

GH-157738 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.14 bugs and security fixes label Sep 18, 2026
@bedevere-app

bedevere-app Bot commented Sep 18, 2026

Copy link
Copy Markdown

GH-157739 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.13 bugs and security fixes label Sep 18, 2026
@terryjreedy

Copy link
Copy Markdown
Member

@serhiy-storchaka CAPS LOCK: Merge conflict only on 3.15 backport. 3.14 and 3.13 on automerge.

terryjreedy added a commit that referenced this pull request Sep 18, 2026
…7709) (#157739)

gh-56596: Make IDLE key bindings work with Caps Lock on (GH-157709)

Tk does not fold the case of letter keysyms, and Caps Lock changes it,
so bind each key sequence with the other case of its letters too.
---------
(cherry picked from commit 0b18efd)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
terryjreedy added a commit that referenced this pull request Sep 18, 2026
…7709) (#157738)

gh-56596: Make IDLE key bindings work with Caps Lock on (GH-157709)

Tk does not fold the case of letter keysyms, and Caps Lock changes it,
so bind each key sequence with the other case of its letters too.
---------
(cherry picked from commit 0b18efd)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
@serhiy-storchaka
serhiy-storchaka deleted the gh-56596-capslock branch September 18, 2026 09:49
@serhiy-storchaka

Copy link
Copy Markdown
Member Author

I think it depends on one of other not merged backports.

@terryjreedy

Copy link
Copy Markdown
Member

I realized that a few hours ago. I added a draft 'Make 3.15 backport` issue, in sequence, pointing to this PR. This itself is 'Done' and hidden by default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs backport to 3.15 pre-release feature fixes, bugs and security fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants