Simon Bachmann
2004-01-07 20:09:14 UTC
Hi!
I've got a question/problem about tk bindigs (`bind' command).
Suppose you are writing an editor in tcl/tk which should have, of
course, braces highligthing ( --> when you close a ),] or } the
openening brace blinks).
To implement that you use someting similar:
bind .textwidget parenright
{command_to_search_and_blink_corresponding_brace...}
bind .textwidget braceright
{command_to_search_and_blink_corresponding_brace...}
bind .textwidget bracketright
{command_to_search_and_blink_corresponding_brace...}
....and all works fine.
Then your editor is used by a user with a keyboard layout where to
insert {}'s and []'s he needs to press the `Alt-Gr' key (Keysym on my
system: Mode_switch) together with anoter key. Your brace highligthin
won't work!!!
In facts, pressing AltGr with anoter key, the event that is generated is
this key to be pressed alone, and not the combination. Here's an example
for more clairity:
to insert a '}' you need to press AltGr-$. Pressing this key combination
the <KeyPress-$> event occurs, and not <KeyPress-braceright> (but the
inserted character is '}' and not '$')!
Is that a bug?
Thanks...
I've got a question/problem about tk bindigs (`bind' command).
Suppose you are writing an editor in tcl/tk which should have, of
course, braces highligthing ( --> when you close a ),] or } the
openening brace blinks).
To implement that you use someting similar:
bind .textwidget parenright
{command_to_search_and_blink_corresponding_brace...}
bind .textwidget braceright
{command_to_search_and_blink_corresponding_brace...}
bind .textwidget bracketright
{command_to_search_and_blink_corresponding_brace...}
....and all works fine.
Then your editor is used by a user with a keyboard layout where to
insert {}'s and []'s he needs to press the `Alt-Gr' key (Keysym on my
system: Mode_switch) together with anoter key. Your brace highligthin
won't work!!!
In facts, pressing AltGr with anoter key, the event that is generated is
this key to be pressed alone, and not the combination. Here's an example
for more clairity:
to insert a '}' you need to press AltGr-$. Pressing this key combination
the <KeyPress-$> event occurs, and not <KeyPress-braceright> (but the
inserted character is '}' and not '$')!
Is that a bug?
Thanks...