Determining Length of Keypress

This is a discussion on Determining Length of Keypress within the C++ Programming forums, part of the General Programming Boards category; This question was moved to the Windows section, but I think there was a misunderstanding as I'm making a C++ ...

  1. #1
    Registered User
    Join Date
    Nov 2005
    Posts
    4

    Determining Length of Keypress

    This question was moved to the Windows section, but I think there was a misunderstanding as I'm making a C++ program using Dev-C++.

    I'd like to be able to tell when the user has held down the key for double or triple the time of a normal keypress. For instance, tapping 'T' causes the gun to fire single shots, but holding 'T' down will cause a more powerful shot to occur after 1 second or half a second of holding down 'T'.

    Thank you for your help.

  2. #2
    the Great ElastoManiac's Avatar
    Join Date
    Nov 2005
    Location
    Republika Srpska - Balkan
    Posts
    377
    So how are you gonna do it, if your not using WM_KEYDOWN ?
    lu lu lu I've got some apples lu lu lu You've got some too lu lu lu Let's make some applesauce Take off our clothes and lu lu lu

  3. #3
    Registered User
    Join Date
    Nov 2005
    Posts
    673
    About the only way to do that is to Use WM_KEYDOWN, so no misunderstanding I do not think. In certain areas of C++ to do certain things you have to use non-standard code.

  4. #4
    Registered User
    Join Date
    Nov 2005
    Posts
    4
    Ok, gotcha. Sorry ElastoManiac, I thought I may have given the wrong idea first time around about what I was trying to do.

    Thanks for the help, I'll learn up on WM_KEYDOWN.

    In certain areas of C++ to do certain things you have to use non-standard code.
    Duly noted.

    Have a good one.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. char Handling, probably typical newbie stuff
    By Neolyth in forum C Programming
    Replies: 16
    Last Post: 06-21-2009, 04:05 AM
  2. Strange string behavior
    By jcafaro10 in forum C Programming
    Replies: 2
    Last Post: 04-07-2009, 07:38 PM
  3. Need help with a snake game (ncurses)
    By Adam4444 in forum C Programming
    Replies: 11
    Last Post: 01-17-2007, 02:41 PM
  4. Determining external path length of a tree
    By kolistivra in forum C Programming
    Replies: 11
    Last Post: 09-01-2006, 10:22 AM
  5. Length of keypress question
    By Nascent in forum Windows Programming
    Replies: 4
    Last Post: 11-30-2005, 01:48 PM

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