| Ticket UUID: | f492c3de04c26a18cfe9c116c1f67ff3b8f3cbae | |||
| Title: | MS-Win: characters entered via an IME or the touch keyboard get the keysym of a function key (F1, F3, F5, ...) | |||
| Type: | Bug | Version: | 8.6, 9.0, main | |
| Submitter: | serhiy.storchaka | Created on: | 2026-09-18 17:30:25 | |
| Subsystem: | 69. Events | Assigned To: | jan.nijtmans | |
| Priority: | 5 Medium | Severity: | Important | |
| Status: | Closed | Last Modified: | 2026-09-23 08:33:29 | |
| Resolution: | Fixed | Closed By: | jan.nijtmans | |
| Closed on: | 2026-09-22 19:06:22 | |||
| Description: |
On Windows, text committed by an input method (e.g. Microsoft Pinyin: type "r", press Enter) or entered with the touch keyboard produces a KeyPress event whose keysym is a function key:
so bindings to Cause: such text arrives as The re-post is not needed to get the character: Reported against Tkinter: https://github.com/python/cpython/issues/125349, https://github.com/python/cpython/issues/146030 | |||
| User Comments: |
serhiy.storchaka added on 2026-09-23 08:33:29:
Merged into core-8-6-branch by commit [4a7d6f6b76]. jan.nijtmans added on 2026-09-22 19:06:22: Fixed [a444f9c1a5359913|here], also backported to Tk 9.0 jan.nijtmans added on 2026-09-22 07:11:12: I'm having a look serhiy.storchaka added on 2026-09-22 06:29:42: Added test event-8.4 in [0ab232eaf6]: characters entered via an input method (Latin, Cyrillic and a non-BMP character which arrives as a surrogate pair) generate only the KeyPress/KeyRelease pairs with %A set; before the fix there was an extra pair with empty %A for each VK_PACKET keystroke. The test uses the testsendinput command (testsendinput unicode sends the characters with KEYEVENTF_UNICODE), which came with the merge of the win-unicode-keyinput branch ([837a9f1dcc]), since this branch is based on it. The same command is added on the branches for [52e9b0f52c] and [2225507]. Merging them will conflict in win/tkWinTest.c and tests/constraints.tcl: keep one copy of the command and the constraint (they are identical), and keep the tests of all branches. serhiy.storchaka added on 2026-09-18 17:48:40: Reproduced on Windows 11 by posting the message sequence of an IME (WM_KEYDOWN with VK_PACKET, WM_CHAR, WM_KEYUP): %K F3 %A "" %k 114 followed by the character event. Fixed on branch win-vk-packet in [f173717bf1] (on top of win-unicode-keyinput): no events are generated for the VK_PACKET key itself, the WM_CHAR message generates the key events with keycode 0. | |||
Home
Timeline
Branches
Tags
Forum
Tickets
Download
Wiki