Thread: How do I capture the up-, down-, left- and right arrowkeys in c++?

  1. #1
    Registered User
    Join Date
    Apr 2003
    Posts
    1

    How do I capture the up-, down-, left- and right arrowkeys in c++?

    I'd like to use the arrow-keys in my program, but I don't know how to access them. Do they have some sort of ascii-code of corresponding, cause they must be accessible through c++, aren't they?

    Any help is greatly appreciated. Thanks in advance,

    archaxe

  2. #2
    Registered User
    Join Date
    Nov 2002
    Posts
    1,109
    search.

  3. #3
    Registered User
    Join Date
    Nov 2001
    Posts
    1,348
    One solution is ::GetKeyState(VK_UP);

    Kuphryn

  4. #4
    Redundantly Redundant RoD's Avatar
    Join Date
    Sep 2002
    Location
    Missouri
    Posts
    6,331
    Look in the FAQ board.....or search, we have gon over this alot. here one way

    Code:
    getch();
    
    case VK_UP:
    break;
    Run with it!

Popular pages Recent additions subscribe to a feed
Website Security Test