bug-ncurses
[Top][All Lists]
Advanced

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

Finer keystroke detection


From: Steve Litt
Subject: Finer keystroke detection
Date: Tue, 11 May 2004 10:17:17 -0400
User-agent: KMail/1.5.3

Hi all,

I've looked thru ncurses.h, and through man terminfo, and various other 
docuemntation, and for the life of me I cannot find how to detect things like 
Ctrl+Enter, Ctrl+F3, etc. These would be VERY handy for an app I'm writing.

I even wrote a keystroke detection program to print out the value of 
keystrokes as I type, and according to that program, Enter, Shift+Enter and 
Ctrl+Enter are identical. According to my program, the alt and Ctrl keys have 
no modification effect on function keys etc.

Could you tell me how to use Curses to make these distinctions?

Below my sig is the detection program I used.

Thanks

STeve

Steve Litt
Author: 
   * Universal Troubleshooting Process courseware
   * Troubleshooting Techniques of the Successful Technologist
   * Rapid Learning: Secret Weapon of the Successful Technologist
Webmaster
   * Troubleshooters.Com
   * http://www.troubleshooters.com

#include <form.h>

int main()
{
        int ch;
        
        initscr();
        cbreak();
        raw();
        noecho();
        keypad(stdscr, TRUE);
        while((ch = getch()) != KEY_F(1))
                {
                touchwin(stdscr);
                wrefresh(stdscr);
                mvwprintw(stdscr, 10,1,"                                        
  ");
                mvwprintw(stdscr, 10,1,"You pressed char %c, number %ld", ch, 
ch);
                }

        endwin();
        return 0;
}





reply via email to

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