Gp142--help getting kybrd input

This is a discussion on Gp142--help getting kybrd input within the C Programming forums, part of the General Programming Boards category; Ok, the program I'm working on is a small game using the gp142 graphics library. I have the entire program ...

  1. #1
    Registered User
    Join Date
    Dec 2001
    Posts
    4

    Question Gp142--help getting kybrd input

    Ok, the program I'm working on is a small game using the gp142 graphics library. I have the entire program done, and working except for the user input that contols the movment of their character on the screen. I need help getting the program to register a user key press at anypoint while the program is running.

    I'll be up all night, so message back or AIM me at xxxManCheesexxx

    ~Alucard~

  2. #2
    Hamster without a wheel iain's Avatar
    Join Date
    Aug 2001
    Posts
    1,385
    You might try some sort of loop that scans the keyboard for values (eg values of the arrow keys) . I think an if loop would work for determining the keypress and resolving it.

    if (keypress=='X') { //execute} where X is the code gernerated by the key

    or if it is windows (winapi) code, you could borrow some of the DirectX functions, i cant remember them of the top of my head as i have not done dx for so long, but there are the DirectInput routines which can also accomadate for mouse, joystick, ffeedback etc..

    hth
    Monday - what a way to spend a seventh of your life

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Input statement problem
    By une in forum C Programming
    Replies: 3
    Last Post: 05-30-2007, 12:16 AM
  2. For loop problems, input please.
    By xIcyx in forum C Programming
    Replies: 2
    Last Post: 04-22-2007, 04:54 AM
  3. I would love some input on my BST tree.
    By StevenGarcia in forum C++ Programming
    Replies: 4
    Last Post: 01-15-2007, 01:22 AM
  4. Stupid Question
    By digdug4life in forum C++ Programming
    Replies: 22
    Last Post: 05-17-2005, 12:43 PM
  5. Help with Input Checking
    By Derek in forum C Programming
    Replies: 7
    Last Post: 06-17-2003, 04:07 AM

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