terminal emulation problem, or a screwup on my part?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Running the following code in gnome-terminal, 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, I get this:

Home hit
262 406

Which is working.

But no matter how I set numlock, I can't get KEY_A1 on either gnome-terminal or
xterm.

Same story with end, pgup and pgdn.

Am I doing something wrong or is there something wrong with the terminal
emulation (or ncurses)?  Or is it my keyboard (a Microsoft Natural 4000)?

#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;        
}

-- 
MELVILLE THEATRE ~ Melville Sask ~ http://www.melvilletheatre.com

-- 
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines
[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [Fedora Magazine]     [Fedora News]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Maintainers]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [Fedora Fonts]     [ATA RAID]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [SSH]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Tux]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Asterisk PBX]     [Fedora Sparc]     [Fedora Universal Network Connector]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux