Arrow Keys

This is a discussion on Arrow Keys within the C++ Programming forums, part of the General Programming Boards category; How do you get the c++ program to sense the input of the arrow keys? I'm using Borland C++. Can ...

  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,267
    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, 11: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-08-2002, 12:29 AM
  5. Arrow keys
    By Nutshell in forum C Programming
    Replies: 5
    Last Post: 03-27-2002, 11:49 AM

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