Key Value - getchar();

This is a discussion on Key Value - getchar(); within the Linux Programming forums, part of the Platform Specific Boards category; I'm trying to get the Key Codes for keys I press, AND find out the code for EXTENDED KEYS (non-ASCII ...

  1. #1
    Unregistered
    Guest

    Key Value - getchar();

    I'm trying to get the Key Codes for keys I press, AND find out the code for EXTENDED KEYS (non-ASCII keys)

    For some reason nothing happens with F5 and the rest of the function keys send back more than i piece of info,,,So,,, how do I get a straight answer ?

    My Results are to be later implemented in a #define clause in a header file for Direct Terminal IO usage.
    (Doing this on DOS Wasn't a problem using conio.h)


    #include <curses.h>
    #include <stdio.h>

    main()
    {
    int c=0;

    puts("Press key code\n");
    initscr();
    noecho();
    raw();

    c=getch();
    printf(" (%c) Key == %d Code\n", c, c);

    endwin();
    }

  2. #2
    Something Clever ginoitalo's Avatar
    Join Date
    Dec 2001
    Posts
    187
    make sure your telnet application has the keymap correctly set

    and

    that your UNIX/LINUX .profile file is configured correctly.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 16
    Last Post: 11-23-2007, 12:48 PM
  2. Virtual keys
    By Arkanos in forum Windows Programming
    Replies: 4
    Last Post: 12-12-2005, 09:00 AM
  3. Directional Keys - Useing in Console
    By RoD in forum C++ Programming
    Replies: 38
    Last Post: 10-06-2002, 04:42 PM
  4. FAQ: Directional Keys - Useing in Console
    By RoD in forum FAQ Board
    Replies: 38
    Last Post: 10-06-2002, 04:42 PM

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