Advaned keyboard input

This is a discussion on Advaned keyboard input within the A Brief History of Cprogramming.com forums, part of the Community Boards category; Hello I'm making a game and I have a problem. For example I want that when I press the arrow ...

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

    Wink Advaned keyboard input

    Hello
    I'm making a game and I have a problem.
    For example I want that when I press the arrow keys on the keyboard the ball will move across the screen with a slow speed and when I hold the spacebar while moving the ball with the arrow keys, the ball will move faster...

    How do I know whether the spacebar is hold (pressed down) while pressing other keys like the arrow keys...

    Please help me and thank you!

    P.S.
    I use Borland C++ 3.0 (DOS)
    Last edited by zhopon; 12-11-2001 at 03:10 PM.

  2. #2
    A Banana Yoshi's Avatar
    Join Date
    Oct 2001
    Posts
    857
    I don't think they (C++) can "see" two keys at once.
    ----------------------
    Engineer223
    Yoshi

  3. #3
    Unregistered
    Guest
    Yes they most certainly can. If C can not use two keys at once, how is it possible to play DOS games like Doom where you are running AND shooting, using the arrow and ctrl?

    Of course it is possible. I just don't know how its done. Andre Lamothe explains it in his book "Teach yourself game programming in 21 days", but I haven't read over that part in over 2 years.

    He used Microsoft C, but Borland C can do it too. I would need to look it up.

  4. #4
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,596
    You must write a keyboard handler. Look for info on this - it is all over this board - everywhere.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Help using inline assembly for keyboard input
    By sleventeen in forum C Programming
    Replies: 7
    Last Post: 05-10-2009, 01:31 AM
  2. Keyboard Input
    By CaliJoe in forum C++ Programming
    Replies: 3
    Last Post: 05-08-2009, 09:51 AM
  3. Keyboard input in a Dialog
    By ksarkar in forum C++ Programming
    Replies: 1
    Last Post: 05-20-2005, 05:39 AM
  4. Intercepting keyboard input
    By EvBladeRunnervE in forum Windows Programming
    Replies: 3
    Last Post: 01-08-2004, 08:03 AM
  5. Need help with Console Keyboard Input
    By pawelx2 in forum Game Programming
    Replies: 5
    Last Post: 05-30-2002, 11:03 PM

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