Skip to content

IDLE: Unexpected behavior caused by the input method #125349

Open
@Xiaokang2022

Description

@Xiaokang2022

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:

2024-10-12-15-06-39

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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions