Terry J. Reedy added the comment:
Part of this issue is the difference between typing a character at the
keyboard, which produces a key event whose effect is determined by key bindings
(some default, some added) and inserting a character into a Text widget, which
does not produce an event (except, in some sense, \t and \n). Whether or not a
key event results in character insertion depends on key bindings. The visual
effect of inserted chars other than \t and \n is determined by the font. (I
believe I got the above right.) I believe some terminals treat chars coming
over the wire the same as those typed. I am not sure what the Win10 console is
doing with control-x keystrokes.
>>> import sys; out=sys.stdout.write
# use direct write to avoid str(), repr() conversion of control chars
>>> out('\x03')
1 # The first char is an empty thin box in my IDLE.
>>> # type ^C
KeyboardInterrupt
----------
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue23220>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com