Arrow key codes

This is a discussion on Arrow key codes within the C++ Programming forums, part of the General Programming Boards category; Hi, a little problem here...I need to determine which arrow key is pressed in my console app. I can do ...

  1. #1
    Registered User
    Join Date
    Jan 2006
    Location
    Latvia
    Posts
    102

    Arrow key codes

    Hi, a little problem here...I need to determine which arrow key is pressed in my console app. I can do it like that: (with numeric keys and letters)
    Code:
        while(!kbhit());
        char ch=getche();
        switch(ch)
        {
                 case  	 	'1':                      cout<<1;         break;
        }
    But I have no clue how to find out which special key is pressed.

  2. #2

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