Is there a way to do this? GetKey is blocking, but there's no timeout. GetKeyWait_OS can be made blocking but it's timeout parameter means integer seconds, so I can't set it to 500ms. I tried installing a timer whose handler function was using GetKey function, but it didn't work
I would suggest making a loop that would check for both keypresses with a non-blocking input routine (probably the best would be to poll the hardware registers), and timer expiration, and it would terminate with success if a key was pressed, and with failure if it timed out. I'd also suggest checking WikiPrizm for some useful timer/getkey routines that would make this easier Smile
Yes, it's possible, but it's a pain using a loop like that. CPU would work a lot totally unnecessary.
balping wrote:
Yes, it's possible, but it's a pain using a loop like that. CPU would work a lot totally unnecessary.


... But if it's just going to be a blocking GetKey routine that doesn't otherwise allow execution to happen, is there any problem with that?
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement