I have a German QWERTZ keyboard. In my application I bind scripts to
keys accessible via AltGr, e.g. | (bar), \ (backslash), @ (at) etc. This works under Linux and macOS, but not under Windows.
It even works under Linux, which runs in a VirtualBox on this Windows system.
Why are the bindings not working under Windows?
I have a German QWERTZ keyboard. In my application I bind scripts to keys accessible via AltGr, e.g. | (bar), \ (backslash), @ (at) etc. This works under Linux and macOS, but not under Windows.
It even works under Linux, which runs in a VirtualBox on this Windows system.
Why are the bindings not working under Windows?
Execute the following simple script:
package require Tk
catch { console show }
ttk::label .b -text "Press any key to see keycode and keysym"
pack .b
bind . <Any-Key> [list puts "%k %K"]
Then typing "<" and "|" gives the following output:
Linux Tcl 8.6.17:
94 less
108 ISO_Level3_Shift
94 bar
Linux Tcl 9.0.3:
94 <
108 ISO_Level3_Shift
94 |
Windows Tcl 8.6.17:
226 less
17 Control_L
18 Alt_R
226 less
Windows Tcl 9.0.3:
226 <
17 Control_L
18 Alt_R
226 <
Am 12.01.2026 um 15:04 schrieb Torsten:
I have a German QWERTZ keyboard. In my application I bind scripts to keys accessible via AltGr, e.g. | (bar), \ (backslash), @ (at) etc. This works under Linux and macOS, but not under Windows.
It even works under Linux, which runs in a VirtualBox on this Windows system.
Why are the bindings not working under Windows?
Can confirm the behaviour of Torsten on German keyboards.
Execute the following simple script:
package require Tk
catch { console show }
ttk::label .b -text "Press any key to see keycode and keysym"
pack .b
bind . <Any-Key> [list puts "%k %K"]
Then typing "<" and "|" gives the following output:
Linux Tcl 8.6.17:
94 less
108 ISO_Level3_Shift
94 bar
Linux Tcl 9.0.3:
94 <
108 ISO_Level3_Shift
94 |
Windows Tcl 8.6.17:
226 less
17 Control_L
18 Alt_R
226 less
Windows Tcl 9.0.3:
226 <
bind . <<> {puts fired}virtual event "<<>>" is badly formed
bind . <>> {puts fired}no event type or button # or keysym
Paul Obermeier <obermeier@poSoft.de> writes:
Am 12.01.2026 um 15:04 schrieb Torsten:
^^^^^^^^
Which is a partiuclary bad reply because "<" is not allowed as
sequence in a bind command (as the documentation in fact mentions):
bind . <<> {puts fired}virtual event "<<>>" is badly formed
Just as bad with ">". Reported as > by %K with 9.0.3.
bind . <>> {puts fired}no event type or button # or keysym
| Sysop: | Amessyroom |
|---|---|
| Location: | Fayetteville, NC |
| Users: | 54 |
| Nodes: | 6 (0 / 6) |
| Uptime: | 01:36:45 |
| Calls: | 743 |
| Files: | 1,218 |
| Messages: | 187,735 |