summaryrefslogtreecommitdiff
path: root/Doc/library/curses.rst
diff options
context:
space:
mode:
Diffstat (limited to 'Doc/library/curses.rst')
-rw-r--r--Doc/library/curses.rst38
1 files changed, 34 insertions, 4 deletions
diff --git a/Doc/library/curses.rst b/Doc/library/curses.rst
index d2c2316186..314636e4b4 100644
--- a/Doc/library/curses.rst
+++ b/Doc/library/curses.rst
@@ -377,7 +377,7 @@ The module :mod:`curses` defines the following functions:
is to be displayed.
-.. function:: newwin(begin_y, begin_x)
+.. function:: newwin(nlines, ncols)
newwin(nlines, ncols, begin_y, begin_x)
Return a new window, whose left-upper corner is at ``(begin_y, begin_x)``, and
@@ -599,6 +599,17 @@ The module :mod:`curses` defines the following functions:
Only one *ch* can be pushed before :meth:`getch` is called.
+.. function:: unget_wch(ch)
+
+ Push *ch* so the next :meth:`get_wch` will return it.
+
+ .. note::
+
+ Only one *ch* can be pushed before :meth:`get_wch` is called.
+
+ .. versionadded:: 3.3
+
+
.. function:: ungetmouse(id, x, y, z, bstate)
Push a :const:`KEY_MOUSE` event onto the input queue, associating the given
@@ -643,7 +654,7 @@ Window Objects
--------------
Window objects, as returned by :func:`initscr` and :func:`newwin` above, have
-the following methods:
+the following methods and attributes:
.. method:: window.addch(ch[, attr])
@@ -831,6 +842,16 @@ the following methods:
event.
+.. attribute:: window.encoding
+
+ Encoding used to encode method arguments (Unicode strings and characters).
+ The encoding attribute is inherited from the parent window when a subwindow
+ is created, for example with :meth:`window.subwin`. By default, the locale
+ encoding is used (see :func:`locale.getpreferredencoding`).
+
+ .. versionadded:: 3.3
+
+
.. method:: window.erase()
Clear the window.
@@ -854,11 +875,20 @@ the following methods:
until a key is pressed.
+.. method:: window.get_wch([y, x])
+
+ Get a wide character. Return a character for most keys, or an integer for
+ function keys, keypad keys, and other special keys.
+
+ .. versionadded:: 3.3
+
+
.. method:: window.getkey([y, x])
Get a character, returning a string instead of an integer, as :meth:`getch`
- does. Function keys, keypad keys and so on return a multibyte string containing
- the key name. In no-delay mode, an exception is raised if there is no input.
+ does. Function keys, keypad keys and other special keys return a multibyte
+ string containing the key name. In no-delay mode, an exception is raised if
+ there is no input.
.. method:: window.getmaxyx()