STINNER Victor added the comment: Oh, right. I agree that the current implementation of window.get_wch() is useless. I missed completly key codes.
Attached patch changes the API of get_wch() from get_wch()->key:int to get_wch()->(is_key_code: bool, key: str). Examples: (True, 'KEY_UP'), (False, 'é'). Problem: unget_wch() test fails. "unget_wch('é'); is_key_code, ch = win.get_wch()" returns is_key_code=True, ch=''. I don't see how to specify to unget_wch() if the argument is a key code or not... It's maybe an issue in unget_wch() API that cannot be fixed in Python? ---------- keywords: +patch Added file: http://bugs.python.org/file27007/curses_get_wch.patch _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue15785> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com