This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: IDLE Classic Unix keyboard shortcuts broken
Type: behavior Stage: resolved
Components: IDLE Versions: Python 3.9
process
Status: closed Resolution: third party
Dependencies: Superseder:
Assigned To: terry.reedy Nosy List: Alan Moore, serhiy.storchaka, terry.reedy
Priority: normal Keywords:

Created on 2021-02-16 18:37 by Alan Moore, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Messages (6)
msg387124 - (view) Author: Alan Moore (Alan Moore) * Date: 2021-02-16 18:37
Using IDLE 3.9.1 on Arch Linux.

In IDLE I've selected the "classic unix" key set.  It worked for a while, then stopped registering key combinations for more than one key (e.g. Ctrl-x Ctrl-s).

Have tried creating a custom key set and manually setting the shortcuts, but it still fails the same way.  Caps lock is not on (disabled on my system).

Have also tried moving configs and starting fresh, does not help.

It had been working, then suddenly stopped in the middle of a work day and I can't get it working again.
msg387127 - (view) Author: Alan Moore (Alan Moore) * Date: 2021-02-16 19:17
OK, it seems that closing all my firefox windows restored correct behavior to IDLE.  I can only guess that somehow firefox was eating the Ctrl-x.

Not sure if this is a firefox issue, a window manager issue, or an IDLE issue.  If you think it's not the latter, feel free to close.
msg387135 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2021-02-17 04:18
IDLE just tells tcl/tk via tkinter what function to call when particular UI events happen.  Recognizing UI events is handled between the OS window manager and tcl/tk. So I am sure this is not an IDLE issue.

For another application to affect the Linux-tcl interaction is new to me.  Serhiy, have you ever heard of such a thing, or seen it happen?
msg387168 - (view) Author: Alan Moore (Alan Moore) * Date: 2021-02-17 17:24
An interesting note this morning, and again I don't know if this is actually an IDLE bug; I had left IDLE running overnight and opened a new code window this morning.  Somehow IDLE "forgot" that Ctrl-N means "next line" and not "new window".  I closed all my firefox windows, then went into IDLE settings, changed the key set to something else and back to Classic Unix, now it works correctly again.

Firefox has been known to steal my keyboard input from time to time when not focused, though it's usually all-or-nothing.  I don't know if it's the culprit or if I'm just blaming it due to past prejudice, but it seems to set things right in IDLE faster if I close all firefox windows.

In any case, I don't know if this could be an IDLE bug or not, just thought I'd share.
msg387170 - (view) Author: Alan Moore (Alan Moore) * Date: 2021-02-17 17:40
Ok, sorry to keep poking at this issue, but I think I was too hasty in blaming firefox.

As I previously mentioned, IDLE "forgot" that Ctrl-N meant "next line" and reverted it to "new window".  I fixed that behavior by changing and resetting the key set, HOWEVER, now the multiple-key sequences like Ctrl-X-Ctrl-S are broken again.  Closing all other programs, rebooting the system, defaulting my IDLE configuration -- none of that makes a difference.  Truly I'm baffled.

Is there actually code in IDLE/Tkinter to handle those kind of keyboard shortcuts, or is that a Tcl/Tk feature that is merely exposed by the Python side?  If the former, could someone point me in the direction of said code?
msg387188 - (view) Author: Alan Moore (Alan Moore) * Date: 2021-02-17 20:15
Spent some time today with IDLE and PDB, and I've ruled out any other program on my system as the culprit:

- I can create a tkinter GUI that will respond to a binding like <Control-Key-x><Control-Key-s> and it works fine.
- In pdb, I can bind <<do-nothing>> to a callback and it is getting fired when Ctrl-x is pressed.  Thus, I was wrong to think anything else is "eating" the ctrl-x.
- Also in pdb, an .event_info('<<save-window>>') call on the editor's Text widget returns ('<Control-Key-x><Control-Key-s>',), so it looks bound correctly?  If I generate a <<save-window>> event, the dialog pops up as it should.

Nevertheless, Ctrl-x Ctrl-s opens the find dialog, and no other Ctrl-x (other keystroke) binding works.  I'm stumped.
History
Date User Action Args
2022-04-11 14:59:41adminsetgithub: 87406
2021-02-17 20:15:42Alan Mooresetmessages: + msg387188
2021-02-17 17:40:29Alan Mooresetmessages: + msg387170
2021-02-17 17:24:54Alan Mooresetmessages: + msg387168
2021-02-17 04:18:52terry.reedysetstatus: open -> closed

nosy: + serhiy.storchaka
messages: + msg387135

resolution: third party
stage: resolved
2021-02-16 19:17:08Alan Mooresetmessages: + msg387127
2021-02-16 18:37:48Alan Moorecreate