Arrow and function keys

This is a discussion on Arrow and function keys within the Linux Programming forums, part of the Platform Specific Boards category; Is there a way for me to check for arrow/function keys from user input. (ncurses?). Thanks Skarr...

  1. #1
    Registered User
    Join Date
    Jul 2002
    Posts
    29

    Arrow and function keys

    Is there a way for me to check for arrow/function keys from user input. (ncurses?).

    Thanks
    Skarr
    I like traffic lights. I like traffic lights. I like traffic lights, but only when they're green.

  2. #2
    Registered User Fredd's Avatar
    Join Date
    Oct 2002
    Posts
    69
    Yes, there is a way with ncurses.
    Code:
    keypad(stdscr, TRUE)
    after that you can use KEY_UP for up arrow KEY_DOWN for down, etc.
    for function keys I think it is KEY_F(n) not sure though.

    more info: man keypad.
    and/or
    http://en.tldp.org/HOWTO/NCURSES-Programming-HOWTO/
    "Writing software is more fun than working."

    got slack?
    http://www.slackware.com/

  3. #3
    Registered User
    Join Date
    Jul 2002
    Posts
    29
    Uh, how do I check for the escape key?
    Last edited by Skarr; 02-12-2003 at 12:42 PM.
    I like traffic lights. I like traffic lights. I like traffic lights, but only when they're green.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Implenting Function Keys
    By frassunit in forum C Programming
    Replies: 14
    Last Post: 11-12-2008, 11:31 AM
  2. Text game arrow keys
    By swgh in forum C++ Programming
    Replies: 6
    Last Post: 01-17-2006, 05:41 AM
  3. Selecting Menu using keyboard arrow keys
    By darkmessiah in forum C Programming
    Replies: 5
    Last Post: 06-07-2005, 12:07 PM
  4. Specific Keys in C, getting and putting
    By Axpen in forum C Programming
    Replies: 17
    Last Post: 01-08-2004, 09:54 PM
  5. problem with arrow keys and MSVC++
    By revelation437 in forum C++ Programming
    Replies: 2
    Last Post: 04-30-2003, 12:41 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21