• Advertisement

Archived

This topic is now archived and is closed to further replies.

Question about a very simple keyboard app.

This topic is 5997 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello, without using DINPUT, is ther anyway I can write a function or macro for that matter where I can simply detect if A kay was pressed. For example if I have a window that is displayed and it says, "Press any key to continue" how can I detect if any key is pressed so the prog can continue. Is there some VK code like VK_KEY_PRESSED or something like that that I can use to see if any key is pressed without having to specify a particular key? Thanks for your input!!! ~ Boltimus ~

Share this post


Link to post
Share on other sites
Advertisement
use some tool like spy++ and see what messages is sent to your application when you press a key, then listen for those messages...

- I''m not sure it''ll work since I have no means of testing it right now - but this or some other modification of this should work.


Share this post


Link to post
Share on other sites
Guest Anonymous Poster
How to wait until any key is pressed:

for (bool down=false; !down
for (int i=1; i<0xFE; i++)
if (GetKeyState(i) & 0x8000)
down = true;

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
looks like my post got messed up. instead of the smiley is a semi-colon and then a close parentheses

Share this post


Link to post
Share on other sites

  • Advertisement