bug-ncurses
[Top][All Lists]
Advanced

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

Alt+Key, Panels and Mouse events


From: Sadrul H Chowdhury
Subject: Alt+Key, Panels and Mouse events
Date: Wed, 2 Aug 2006 10:08:28 -0400

Hi.

(1) I am trying to have shortcut keys like Alt+n, Alt+p etc. to trigger some events in my application. However, it seems the keys produce different codes in different terminals. For example, these are the codes I get:

Key      Xterm      mrxvt/urxvt
Alt+a    195 161      27 97
Alt+b    195 162      27 98
Alt+c    195 163      27 99

What would be the best way to handle the keystrokes for all terminals? (The program I used is given at the end)

(2) I have several WINDOWs on screen, each on its own PANEL. I want to dump the contents of the screen in text/HTML format on some event. Is there a way I can get the contents of (row, column) without knowing what window/panel is being displayed at that position? I am aware of inch-family of functions. But they ask for a WINDOW, and I am not sure which WINDOW is on top at that moment at that position.

(3) To deal with mouse-events, when I click on a position, is there any way to know which PANEL/WINDOW is being shown at that position? This would solve (2) I think.

Thanks.
Sadrul

/*** CODE ***/
#include <ncurses.h>

int main()
{
    int key;

    initscr();
    noecho();

    while ((key = getch()))
    {
        printf("%d ", key);
        refresh();
    }

    endwin();

    return 0;
}

/*** CODE END ***/

reply via email to

[Prev in Thread] Current Thread [Next in Thread]