Skip to content

gh-75234: Fix keyboard selection in the lists of IDLE Settings - #157588

Merged
terryjreedy merged 2 commits into
python:mainfrom
serhiy-storchaka:gh-75234-helplist-keys
Sep 21, 2026
Merged

terryjreedy merged 2 commits into
python:mainfrom
serhiy-storchaka:gh-75234-helplist-keys

Conversation

@serhiy-storchaka

@serhiy-storchaka serhiy-storchaka commented Sep 15, 2026

Copy link
Copy Markdown
Member

The Up and Down keys move the selection in the key bindings list and in the help sources list, but not the anchor used by the buttons. So the buttons stayed disabled after keyboard navigation, or acted on the previously clicked item. Move the anchor on the key events, as the font list already does. The key bindings list can now also be focused with Tab.

🤖 Generated with Claude Code

The Up and Down keys move the selection in the help sources and key
bindings lists, but not the anchor. So the buttons that act on the
selected item stayed disabled, and acted on the anchored item instead
of the selected one. Move the anchor on the key events, as the font
list already does.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@serhiy-storchaka serhiy-storchaka added needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes needs backport to 3.15 pre-release feature fixes, bugs and security fixes labels Sep 15, 2026

@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.

Testing the current keylist I notice:

  1. Initially nothing is selected; Up and Down do not work because there is nothing to move.
  2. Click top item, move down, selection moves down, hit button, notice that wrong item is being modified, cancel, top item is reselected but lower selection remains. Up/Down fail when ambiguous.

After patch, the top line is underlined but not 'selected' in that it does not have the selection background and the Get button is inactive. One must either click or Down, Up to select it. This is similar to completion lists, where I find it annoying and want a fix.

I would like top item initially selected, but will merge as is if you disagree much.

@bedevere-app

bedevere-app Bot commented Sep 20, 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.

@serhiy-storchaka

serhiy-storchaka commented Sep 21, 2026

Copy link
Copy Markdown
Member Author

I have made the requested changes; please review again.

This is a simple tweak of the current code. This code is a good candidate for treeview, and I am planning to redesign keys, hightlights and fonts configuration later.

@bedevere-app

bedevere-app Bot commented Sep 21, 2026

Copy link
Copy Markdown

Thanks for making the requested changes!

@terryjreedy: please review the changes made to this pull request.

@bedevere-app
bedevere-app Bot requested a review from terryjreedy September 21, 2026 10:42

@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.

The additional helper list still requires a click before up/down works, but this is OK with me for now. We should have already been using a custom listbox for these multiple uses. See DM for treeview question.

@terryjreedy
terryjreedy merged commit 212e603 into python:main Sep 21, 2026
56 of 60 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.
🐍🍒⛏🤖

@bedevere-app

bedevere-app Bot commented Sep 21, 2026

Copy link
Copy Markdown

GH-157929 is a backport of this pull request to the 3.15 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.15 pre-release feature fixes, bugs and security fixes label Sep 21, 2026
@bedevere-app

bedevere-app Bot commented Sep 21, 2026

Copy link
Copy Markdown

GH-157930 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 21, 2026
@bedevere-app

bedevere-app Bot commented Sep 21, 2026

Copy link
Copy Markdown

GH-157931 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 21, 2026
terryjreedy pushed a commit that referenced this pull request Sep 21, 2026
…GH-157588) (#157931)

gh-75234: Fix keyboard selection in the lists of IDLE Settings (GH-157588)

The Up and Down keys move the selection in the help sources and key
bindings lists, but not the anchor. So the buttons that act on the
selected item stayed disabled, and acted on the anchored item instead
of the selected one. Move the anchor on the key events, as the font
list already does.

---------
(cherry picked from commit 212e603)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
terryjreedy pushed a commit that referenced this pull request Sep 21, 2026
…GH-157588) (#157930)

gh-75234: Fix keyboard selection in the lists of IDLE Settings (GH-157588)

The Up and Down keys move the selection in the help sources and key
bindings lists, but not the anchor. So the buttons that act on the
selected item stayed disabled, and acted on the anchored item instead
of the selected one. Move the anchor on the key events, as the font
list already does.

---------
(cherry picked from commit 212e603)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
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