[New-bugs-announce] [issue15785] curses.get_wch() returns keypad codes incorrectly

Adam Simpkins report at bugs.python.org
Sun Aug 26 12:09:38 CEST 2012

New submission from Adam Simpkins:

The curses.get_wch() function does not check if wget_wch() returned OK or KEY_CODE_YES.  In either case, it simply returns the character code.

This makes get_wch() unusable when keypad is enabled, because the caller cannot distinguish function key or arrow key presses from real unicode code points.  For example, get_wch() returns 259 both for an up arrow press and for the input character 'ă'.

It seems like this API needs to be redesigned somehow to allow terminal keypad codes to be distinguished from unicode input.

components: Library (Lib)
messages: 169165
nosy: simpkins
priority: normal
severity: normal
status: open
title: curses.get_wch() returns keypad codes incorrectly
type: behavior
versions: Python 3.3, Python 3.4

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list