Thread: Arrow Keys

  1. #1
    Registered User
    Join Date
    Feb 2002
    Posts
    20

    Arrow Arrow Keys

    How do you get the c++ program to sense the input of the arrow keys? I'm using Borland C++. Can you give me an example?

  2. #2
    Has a Masters in B.S.
    Join Date
    Aug 2001
    Posts
    2,263
    use these with getch() or getchar whenever you want to test for keys.

    left arrow = 'K'
    up arrow = 'H'
    down arrow = 'P'
    right arrow = 'M'

    like
    Code:
    char ch;
    
    //do stuff...
    ch = getch();
    if(ch == 'H')
        //do something for the UP arrow
    ect...
    ADVISORY: This users posts are rated CP-MA, for Mature Audiences only.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Movement with arrow keys
    By louis_mine in forum C Programming
    Replies: 3
    Last Post: 02-06-2005, 04:35 PM
  2. Interfacing with arrow keys...
    By adityakarnad in forum Game Programming
    Replies: 1
    Last Post: 08-30-2003, 10:25 PM
  3. Ascii code for arrow keys
    By beginner in forum C Programming
    Replies: 1
    Last Post: 11-07-2002, 01:29 PM
  4. msdos arrow keys?
    By seditee in forum Game Programming
    Replies: 3
    Last Post: 05-07-2002, 11:29 PM
  5. Arrow keys
    By Nutshell in forum C Programming
    Replies: 5
    Last Post: 03-27-2002, 11:49 AM