Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion Doc/library/msvcrt.rst
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,9 @@ Console I/O
is not already available, but will not wait for :kbd:`Enter` to be
pressed. If the pressed key was a special function key, this will
return ``'\000'`` or ``'\xe0'``; the next call will return the keycode.
The :kbd:`Control-C` keypress cannot be read with this function.
When pressed while this function is waiting for input, :kbd:`Control-C`
can be read as ``b'\x03'`` without invoking the :const:`signal.SIGINT`
handler.


.. function:: getwch()
Expand Down
7 changes: 4 additions & 3 deletions PC/clinic/msvcrtmodule.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions PC/msvcrtmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -227,13 +227,14 @@ Read a keypress and return the resulting character as a byte string.
Nothing is echoed to the console. This call will block if a keypress is
not already available, but will not wait for Enter to be pressed. If the
pressed key was a special function key, this will return '\000' or
'\xe0'; the next call will return the keycode. The Control-C keypress
cannot be read with this function.
'\xe0'; the next call will return the keycode.
When pressed while this function is waiting for input, Control-C can be
read as b'\x03' without invoking the signal.SIGINT handler.
[clinic start generated code]*/

static int
msvcrt_getch_impl(PyObject *module)
/*[clinic end generated code: output=a4e51f0565064a7d input=37a40cf0ed0d1153]*/
/*[clinic end generated code: output=a4e51f0565064a7d input=5c91f51ac2355241]*/
{
int ch;

Expand Down
Loading