tkinter: Unexpected behavior caused by Chinese input method
Nessuno ha ancora preso questa issue.
- Lingua principale
- Python
- Stelle
- 77.2k
- Fork
- 36k
- Metriche di merge delle PR
- Metriche PR in attesa
Descrizione
Bug report
Bug description:
Entering "r", "t" or "p" in the Chinese input method and press Enter in the editor will cause IDLE to behave unexpectedly.
"r": Equivalent to pressing"F3"(will excute command "Find Selection")"t": Equivalent to pressing"F5"(will excute command "Run Module")"p": Equivalent to pressing"F1"(will open Python docs link)
There may be other similar situations, and I will list three of them here. The input method I used for my test is native to the Windows operating system.
I'm not sure if this problem is caused by the input method or the tkinter event binding, maybe it's not an idle issue, but a tkinter issue. If this issue is not resolved, it will greatly affect the experience of using input methods in IDLE.
The following is a gif demonstration that reproduces the issue:
The event when this behavior is triggered and some of its properties are as follows:
| letter | event.char |
event.keysym |
event.keycode |
event.keysym_num |
|---|---|---|---|---|
| r | "r" |
F3 | 114 | 65472 |
| t | "t" |
F5 | 116 | 65474 |
| p | "p" |
F1 | 112 | 65470 |
It is clear that this is not the expected behavior. event.keysym does not match event.char.
CPython versions tested on:
3.13
Operating systems tested on:
Windows
Linked PRs
- gh-125352
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia con i binding degli eventi tkinter dell’editor IDLE su Windows e riproduci il comportamento usando il metodo di input cinese con r, t e p seguiti da Enter. Confronta event.char con event.keysym, keycode e keysym_num e analizza la PR collegata gh-125352. Il lavoro è completato quando questi input non attivano più inaspettatamente i comandi F3, F5 o F1.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- python
- Ambito
- desktop
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 25/100