gh-75234: Fix keyboard selection in the lists of IDLE Settings - #157588
Conversation
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>
terryjreedy
left a comment
There was a problem hiding this comment.
Testing the current keylist I notice:
- Initially nothing is selected; Up and Down do not work because there is nothing to move.
- 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.
|
When you're done making the requested changes, leave the comment: |
|
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. |
|
Thanks for making the requested changes! @terryjreedy: please review the changes made to this pull request. |
terryjreedy
left a comment
There was a problem hiding this comment.
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.
|
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. |
|
GH-157929 is a backport of this pull request to the 3.15 branch. |
|
GH-157930 is a backport of this pull request to the 3.14 branch. |
|
GH-157931 is a backport of this pull request to the 3.13 branch. |
…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>
…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>
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