Bug #9094

Curses.getch() function responds twice for unicode keys

Added by Johan Walles almost 2 years ago. Updated over 1 year ago.

Status:Third Party's Issue
ruby -v:ruby 2.1.0dev (2013-10-30 trunk 43476) [x86_64-darwin13.0.0] Backport:1.9.3: UNKNOWN, 2.0.0: UNKNOWN


Try this:
1. Write a curses program (or use the attached one).
2. Call Curses.getch()
3. Press "ä" on your keyboard (Swedish layout needed for this)

Current result:
I get two separate results from Curses.getch(), which when merged form a unicode 'ä'; 195 and 164.

Expected result:
I expected one result from Curses.getch() for my single keypress, containing a unicode 'ä'.

It seems as if Curses.getch() ends up in the NCurses getch() function at http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ext/curses/curses.c?revision=43316&view=markup#l647 . Calling wgetch() instead may or may not help.

ruby-curses-getch.rb Magnifier - Example program (293 Bytes) Johan Walles, 11/08/2013 03:45 AM


#1 Updated by Hiroshi SHIBATA over 1 year ago

  • Status changed from Open to Third Party's Issue

curses is extracted from ruby-core. If you still have this issue, Please report to https://github.com/ruby/curses

Also available in: Atom PDF