|
-
August 16th, 2005, 09:32 AM
#1
Capturing the length of a key press
I'm currently writing a piece of code which captures a key press and determines the length of that press, and I'm having trouble deciding how precisely I should go about calculating the lenght of the press. Would a timer be the best idea?
My current setup has an "OnMessage" function which kicks-in whenever a message (key press, alarm activation etc.) is received by the system. I'm not sure if the functionality is such that a continued key press will result in multiples "key pressed" messages being sent to the system, in which case it may be simpler.
If a timer is required, what's the most simple/appropriate method of implementing it?
I'm looking to have say:
1 second press sets i value = 1
5 second press sets i value = 5
10 second press sets i value = 10
And so on...
I need something which regularly checks whether the key is still pressed, and increases the value accordingly.
Many thanks in advance. :-)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|