terminal emulation problem, or a screwup on my part?

3 messages Options
Embed this post
Permalink
Frank Cox

terminal emulation problem, or a screwup on my part?

Reply Threaded More More options
Print post
Permalink
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
[hidden email]
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines
Patrick O'Callaghan-2

Re: terminal emulation problem, or a screwup on my part?

Reply Threaded More More options
Print post
Permalink
On Thu, 2009-11-05 at 01:22 -0600, Frank Cox wrote:
> 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)?

Try xev(1) to see what is actually happening when you hit a key.

poc

--
fedora-list mailing list
[hidden email]
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines
Frank Cox

Re: terminal emulation problem, or a screwup on my part?

Reply Threaded More More options
Print post
Permalink
On Thu, 05 Nov 2009 09:04:46 -0430
Patrick O'Callaghan wrote:

> Try xev(1) to see what is actually happening when you hit a key.

Unless I understand less about the console than I think I do, I'm pretty sure
this issue is beyond that.

ESC
[
1
~

So the input is there.   It's not being captured properly by ncurses for
reasons unknown to me.

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

--
fedora-list mailing list
[hidden email]
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines