tracking keyboard press/release events

This is a discussion on tracking keyboard press/release events within the C++ Programming forums, part of the General Programming Boards category; i'm coding a program that will need to keep track of when the user presses and releases a key on ...

  1. #1
    Unregistered
    Guest

    tracking keyboard press/release events

    i'm coding a program that will need to keep track of when the user presses and releases a key on the keyboard. What methods could i use to keep track of these actions, is there some flag or other way to tell when the user releases a key. I plan on using ctime to keep track of the exact times but need something to alert me of the events.
    thanks

  2. #2
    Registered User
    Join Date
    Aug 2001
    Posts
    223

    kbhit

    look up kbhit() and getch()

    while( kbhit() == 0);
    int value = getch();

    something like that .... But you should really be doing windows programming.
    zMan

  3. #3
    Registered User
    Join Date
    Jul 2002
    Posts
    273
    right, "events" are really not the way DOS works. Windows get's messages for keyboard presses. DOS is just too procedural for that.
    always looking, make an offer. get me out of this place.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. how to handle keyboard and mouse events for all windows
    By manav-II in forum Windows Programming
    Replies: 3
    Last Post: 08-25-2008, 09:03 AM
  2. get keyboard and mouse events
    By ratte in forum Linux Programming
    Replies: 10
    Last Post: 11-17-2007, 04:42 PM
  3. simulate keyboard events on windows xp
    By xximranxx in forum Windows Programming
    Replies: 4
    Last Post: 04-26-2007, 05:43 PM
  4. Virtual keys
    By Arkanos in forum Windows Programming
    Replies: 4
    Last Post: 12-12-2005, 09:00 AM
  5. Keyboard events, dialog boxes.
    By Brian in forum Windows Programming
    Replies: 1
    Last Post: 10-03-2003, 10:20 AM

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