Project

General

Profile

Actions

Bug #9094

closed

Curses.getch() function responds twice for unicode keys

Added by walles (Johan Walles) over 10 years ago. Updated about 10 years ago.

Status:
Third Party's Issue
Assignee:
-
Target version:
-
ruby -v:
ruby 2.1.0dev (2013-10-30 trunk 43476) [x86_64-darwin13.0.0]
[ruby-core:58223]

Description

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 'ä'.

Notes:
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.


Files

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

Updated by hsbt (Hiroshi SHIBATA) about 10 years 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

Actions

Also available in: Atom PDF

Like0
Like0