mirror of
https://github.com/python/cpython.git
synced 2025-08-22 01:35:16 +00:00
Issue #15785: Modify window.get_wch() API of the curses module: return a
character for most keys, and an integer for special keys, instead of always returning an integer. So it is now possible to distinguish special keys like keypad keys.
This commit is contained in:
parent
4e07a8c9aa
commit
1d39cde50c
4 changed files with 20 additions and 13 deletions
|
@ -1203,7 +1203,10 @@ PyCursesWindow_Get_WCh(PyCursesWindowObject *self, PyObject *args)
|
|||
PyErr_SetString(PyCursesError, "no input");
|
||||
return NULL;
|
||||
}
|
||||
return PyLong_FromLong(rtn);
|
||||
if (ct == KEY_CODE_YES)
|
||||
return PyLong_FromLong(rtn);
|
||||
else
|
||||
return PyUnicode_FromOrdinal(rtn);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue