Find the answer to your Linux question:
Results 1 to 4 of 4
Hi all, I need some help. I want to get input from the keyboard and currently using a mirror of kbhit()/getch(); But it does not give me multiple key presses ...
  1. #1
    Just Joined!
    Join Date
    Dec 2007
    Posts
    2

    Simultaneous key input from keyboard in C++

    Hi all,
    I need some help.
    I want to get input from the keyboard and currently using a mirror of kbhit()/getch();
    But it does not give me multiple key presses at a single moment.

    If I press 'a' and 'b' at the same time, I just get either 'a' or 'b' as the input.
    I need them both at the same time, maybe intervened. The same is given by Asynckeystate() in windows.
    Any thing similar to that in Linux??

    Any help would be much appreciated

  2. #2
    Linux Engineer RobinVossen's Avatar
    Join Date
    Aug 2007
    Location
    The Netherlands
    Posts
    1,422
    Not all keyboards can send at the EXACT same time.
    Since keyboards arnt made for that.
    You'll need a USB keyboard for sure to do that. And you'll need to be sure that the OSes Keyboard Buffer Supports DUAL-Keypresses.
    This problem is the biggest problem of Emulated Gamers.


    Sorry to tell you that.

    Cheers,
    Robin
    New Users, please read this..
    Google first, then ask..

  3. #3
    Just Joined!
    Join Date
    Dec 2007
    Posts
    2
    Thanks for the reply.
    Now I want them to alternate one after the other. The same is supported by VC++ using the function mentioned above. When two keys are presses simult, it returns both the keys in sequence one after the other, till the keys remain pressed.
    So cant the same be done on linux.

  4. #4
    Linux Engineer wje_lf's Avatar
    Join Date
    Sep 2007
    Location
    Mariposa
    Posts
    1,192
    Take a look at this thread.

    Hope this helps.
    --
    Bill

    Old age and treachery will overcome youth and skill.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...