(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:
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(); }