Need help with keyboard input

This is a discussion on Need help with keyboard input within the C++ Programming forums, part of the General Programming Boards category; Hi, Im a total newb and I've only just started programming in c++ and Im trying to make a loop ...

  1. #1
    Registered User
    Join Date
    Nov 2003
    Posts
    9

    Unhappy Need help with keyboard input

    Hi,
    Im a total newb and I've only just started programming in c++ and Im trying to make a loop while a keyboard button is being pressed. The problem is I have no idea how to do keyboard input and I don't know what to search for in tutorials.

    Can you please tell me what things I should search for to find a tutorial for this problem?!

    Cheers

  2. #2
    The Defective GRAPE Lurker's Avatar
    Join Date
    Feb 2003
    Posts
    949
    Code:
    cin >> variable
    . You know this site has FAQ's, right?
    Do not make direct eye contact with me.

  3. #3
    Registered User
    Join Date
    Mar 2002
    Posts
    1,595
    it takes a while, but learning how to be as specific as possible does help get meaningful answers. In your case do you want some thing to happen every time somebody enters a certain key or do you want to stop a process that is ongoing when somebody pushes a key? Is the action that will occur input key dependent or will pushing any key trigger the event you want to do? etc. Be as specific as possible. Also what compiler and operating system is available to you, and what is the intended end user for the product?

    To start with you might look up istream methods and if non-standard C++ doesn't bother you, you could look into the function kbhit()---beware, non-standard means not all compilers have kbhit() available.

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, 02:31 AM
  2. Keyboard Input
    By CaliJoe in forum C++ Programming
    Replies: 3
    Last Post: 05-08-2009, 10:51 AM
  3. Keyboard input in a Dialog
    By ksarkar in forum C++ Programming
    Replies: 1
    Last Post: 05-20-2005, 06:39 AM
  4. Intercepting keyboard input
    By EvBladeRunnervE in forum Windows Programming
    Replies: 3
    Last Post: 01-08-2004, 09:03 AM
  5. FAQ Keyboard Input ? (C++)
    By Malikive in forum FAQ Board
    Replies: 6
    Last Post: 11-07-2001, 09:30 PM

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