Bug 533293

Summary: can't capture the keypad home key
Product: [Fedora] Fedora Reporter: Frank Cox <theatre>
Component: gnome-terminalAssignee: Behdad Esfahbod <behdad>
Status: CLOSED WONTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 11CC: behdad, cathryn, mlichvar
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-06-28 15:23:51 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Frank Cox 2009-11-05 22:25:02 UTC
Description of problem:
Running the following code in gnome-terminal on Fedora 11, I get this when I
press 7 on my keypad:

27 33
91 133
49 61
126 176

I can't capture the keypad home key.  If I hit the dedicated home key (between
the keypad and the letter keys, I get this:

Home hit
262 406

So that works.

Running the following code in xterm and at a ASCII (runlevel 3) console, I get this:

Home hit
262 406

Which is better (at least I'm not just getting a raw esc code) but still doesn't provide KEY_A1

I can't get KEY_A1 on either gnome-terminal or xterm.

Same story with the end key.

In short, the 7/home and 1/end keys are somewhat usable from the keypad with xterm and the ASCII console as they become interchangable with the dedicated home and end keys, but from gnome-terminal all you get is a raw esc code.  And KEY_A1 and KEY_C1 never show up at all anywhere with any terminal.


Version-Release number of selected component (if applicable):
ncurses-5.7-2.20090207.fc11.x86_64

How reproducible:
Every time

Steps to Reproduce:
1.Compile and run this:

#include <ncurses.h>
int main(void)
{
	int ch;
	initscr();
	noecho();
	cbreak();
	keypad(stdscr,TRUE); 
	while (ch !='a')
	{
	ch=getch();
	if(ch==KEY_HOME)
		printw("Home hit\n");
	if(ch==KEY_A1)
		printw("A1 hit\n");	
	printw("%d %o\n",ch,ch);
	refresh();
        }        
    endwin();        
    return 0;        
}

2. Hit the 7/home key on your keypad.

  
Actual results:
gnome-terminal gives me this:
27 33
91 133
49 61
126 176

xterm and the ASCII console give me this:
Home hit
262 406

Expected results:
A1 hit

Comment 1 Miroslav Lichvar 2009-11-06 11:00:26 UTC
Real keypad keys are not emulated in xterm, the XK_KP_* keys received from X are just remapped to XK_* keys. They are not even defined in terminfo.

It should be possible to make a custom mapping though, see
http://invisible-island.net/xterm/xterm.faq.html

As for gnome-terminal, this looks like a bug.

Comment 2 Cathryn Mataga 2009-12-20 18:48:47 UTC
I'm seeing this same bug also.   Home and End key on the keypad work correctly in ncurses within xterm, but within gnome-terminal they return an escape sequence.  I'm using 'get_wch' instead and I see basically the same problem.

For a quick verify, run 'alsamixer' from gnome-terminal and press the keypad home or end keys, the program exits immediately.  This is because the home/end is treated like an esc key.  Within xterm these keys function correctly.  Also the non-keypad home and end keys function correctly both in xterm and gnome-terminal.

Comment 3 Cathryn Mataga 2009-12-20 18:57:19 UTC
And I'm running Fedora 12, not 11, updated to current.

Comment 4 Bug Zapper 2010-04-28 11:06:59 UTC
This message is a reminder that Fedora 11 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 11.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '11'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 11's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 11 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 5 Bug Zapper 2010-06-28 15:23:51 UTC
Fedora 11 changed to end-of-life (EOL) status on 2010-06-25. Fedora 11 is 
no longer maintained, which means that it will not receive any further 
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of 
Fedora please feel free to reopen this bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.