numpad

This is a discussion on numpad within the Game Programming forums, part of the General Programming Boards category; im currently working on a game, a 2 player trivia game speed round sorta thing. anyway, i want 1 user ...

  1. #1
    cereal killer dP munky's Avatar
    Join Date
    Nov 2002
    Posts
    655

    numpad

    im currently working on a game, a 2 player trivia game speed round sorta thing. anyway, i want 1 user to use the numbers above the letters on the keyboard, and the other to use the num pad....is there any way to do this? THANKS!
    guns dont kill people, abortion clinics kill people.

  2. #2
    Banned master5001's Avatar
    Join Date
    Aug 2001
    Location
    Visalia, CA, USA
    Posts
    3,685
    Yes. I suppose that answer is insufficient. I will need to ask what OS and API you are using. For example in the win api you can do this

    Code:
    LRESULT callback(HWND hwnd, UINT msg, WPARAM wparam,LPARAM lparam) {
        switch(msg) {
             case WM_KEYUP:
                  if((int) wparam == VK_NUMPAD5) {
                        MessageBox(hwnd, "hello", "message", MB_OK);
                  }
        }
    }

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