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

This is a discussion on How do I capture the up-, down-, left- and right arrowkeys in c++? within the C++ Programming forums, part of the General Programming Boards category; I'd like to use the arrow-keys in my program, but I don't know how to access them. Do they have ...

  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
    RoD
    RoD is offline
    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

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