Skip to content

IDLE save keyboard shortcut problem #56596

Description

@jvanburen
mannequin
BPO 12387
Nosy @rhettinger, @terryjreedy, @kbkaiser, @ned-deily, @serwy, @jvanburen, @ringof
PRs
  • gh-56596: IDLE keyboard shortcuts function irespective of caps-lock state #32245
  • Files
  • windows_caps_lock.patch
  • keybinding-issue12387-v1.diff
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/terryjreedy'
    closed_at = None
    created_at = <Date 2011-06-22.17:59:58.252>
    labels = ['easy', 'expert-IDLE', 'type-bug', '3.7']
    title = 'IDLE save keyboard shortcut problem'
    updated_at = <Date 2022-04-02.01:39:59.903>
    user = 'https://github.com/jvanburen'

    bugs.python.org fields:

    activity = <Date 2022-04-02.01:39:59.903>
    actor = 'dpg'
    assignee = 'terry.reedy'
    closed = False
    closed_date = None
    closer = None
    components = ['IDLE']
    creation = <Date 2011-06-22.17:59:58.252>
    creator = 'Jacob.VB'
    dependencies = []
    files = ['25226', '35592']
    hgrepos = []
    issue_num = 12387
    keywords = ['patch', 'easy']
    message_count = 14.0
    messages = ['138828', '138842', '138843', '158303', '158309', '158312', '158354', '158368', '212611', '212612', '218776', '220331', '220332', '220338']
    nosy_count = 10.0
    nosy_names = ['rhettinger', 'terry.reedy', 'kbk', 'ned.deily', 'roger.serwy', 'westley.martinez', 'python-dev', 'Jacob.VB', 'Saimadhav.Heblikar', 'dpg']
    pr_nums = ['32245']
    priority = 'normal'
    resolution = None
    stage = 'patch review'
    status = 'open'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue12387'
    versions = ['Python 3.6', 'Python 3.7']

    Linked PRs

    Activity

    1. jvanburen commented on Jun 22, 2011

      jvanburenmannequin
      MannequinAuthor

      IDLE (for Python 3.2) fails to save using the ctrl-s keyboard shortcut when caps-lock is enabled, and instead only saves when ctrl-shift-s is pressed.
      When caps-lock is disabled, all shortcuts work normally.

    2. changed the title [-]IDLE save hotkey problem[/-] [+]IDLE save keyboard shortcut problem[/+] on Jun 22, 2011
    3. terryjreedy commented on Jun 23, 2011

      @terryjreedy
      Member

      (The message I deleted was a duplicate of the original).
      Verified with 3.2.0 on WinXP (Jacob, I/O issues, including keyboard, especially need system specified. What is yours? If Windows, this might be Windows-specific.)

      With CAPS LOCK on, Cntl-N, Cntl-O, Cntl-P, Alt-M, Alt-C work.
      Cntl-S, Cntl-Shift-S, Alt-Shift-S, Cntl-Q do not.
      (All of above from File menu). So behavior is variable.

    4. jvanburen commented on Jun 23, 2011

      jvanburenmannequin
      MannequinAuthor

      I'm running Windows 7 Home Premium 64-bit, on an Alienware M17x (a laptop) using the built-in keyboard.

      It's definitely possible that the problem is Windows-specific; perhaps it has to do with the fact that when caps lock is on the shift modifier seems to invert the case back to lowercase; although I don't know how it would affect it in that way.

    5. serwy commented on Apr 15, 2012

      serwymannequin
      Mannequin

      I can confirm this issue on Linux.

      This issue is caused by not explicitly binding <Control-Key-S> to <<save-window>> in config-keys.def (and in configHandler.py's GetCoreKeys.) Presently, only <Control-key-s> binds to <<save-window>>.

      Should all the lowercase bindings without uppercase bindings be changed, or should only a few be changed?

    6. rhettinger commented on Apr 15, 2012

      @rhettinger
      Contributor

      I would like to see them all changed.

    7. terryjreedy commented on Apr 15, 2012

      @terryjreedy
      Member

      I agree; lets be consistently lenient.

    8. serwy commented on Apr 15, 2012

      serwymannequin
      Mannequin

      Attached is a patch to fix the caps-lock issue with Windows key bindings in config-keys.def.

    9. terryjreedy commented on Apr 15, 2012

      @terryjreedy
      Member

      Changes look complete and correct as far as I can tell, except that I have some confusion about the relation of Shift and CapsLock key. For instance, Control-C and Control-Shift-C (using the key labels) both interrupt a loop whether or not CapsLock is on. In all, 4 combinations work even though only 2 are listed.
      interrupt-execution=<Control-Key-c> <Control-Key-C>

      However, this pair of specifications
      +save-window-as-file=<Control-Shift-Key-S> <Control-Shift-Key-s>
      +save-window=<Control-Key-s> <Control-Key-S>
      only makes sense to me if 's' and 'S' refer to the 'S' key without and with CapLock on as using Shift is meant to give a different meaning. It appears to split the 4 combinations into 2 pairs that do different things.

    10. westleymartinez commented on Mar 3, 2014

      westleymartinezmannequin
      Mannequin

      I know that Tk has individual states for whether or not a key is pressed with Caps Lock or Shift or other modifiers, so maybe there is a way to have the shortcuts ignore Caps Lock entirely.

      More info: http://stackoverflow.com/questions/665502/status-of-shift-and-caps-lock-in-python

    11. ned-deily commented on Mar 3, 2014

      @ned-deily
      Member

      See also "Modifier Keys" on the Tk Wiki:
      http://wiki.tcl.tk/28331

      There are both deliberate and accidental platform-specific behavior differences among Tk implementations.

    12. terryjreedy commented on May 19, 2014

      @terryjreedy
      Member

      Reading the Tk Wiki page, it appears that Shift undoes ShiftLock except on Mac, where it does nothing. So there is effectively only ^a and ^A, etc.

      Looking as the Get New Keys dialog, the Basic Key Binding Entry pane says "New keys .." plural, but as far as I can tell, only one new key can be entered. Moreover, Control-Key-a and Control-Shift-Key-A are possible, but not Control-Key-A. The latter is only possible with hand entry in the Advanced Key Binding Entry pane. This might be why some functions have a single key binding and some both. Perhaps the dialog should auto-augment Control-Key-x with Control-Key-X, where x is a lowercase letter.

    13. 3 remaining items

    14. self-assigned this
      on Jun 30, 2017
    15. transferred this issue fromon Apr 10, 2022
    16. moved this to In Progress in IDLE Issueson Jul 27, 2022
    17. serhiy-storchaka commented on Sep 17, 2026

      @serhiy-storchaka
      Member

      Tk does not fold the case of letter keysyms, so a binding has to exist for both cases. #157709 binds the other case automatically when the key sequences are applied to a window, for all keysets and extensions on all platforms; the keysets themselves are unchanged.

    18. added 4 commits that reference this issue on Sep 18, 2026
    19. moved this from In Progress to Done in IDLE Issueson Sep 18, 2026
    20. terryjreedy commented on Sep 18, 2026

      @terryjreedy
      Member

      IDLE issues has an uncategorized draft issue for making and applying the 3.15 backport, after previous on-hold backports.

    21. added a commit that references this issue on Oct 9, 2026
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    Labels

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions