Skip to main content
gamedev.net
🔒 Locked

bool IsKeyPressed(); ???

Started by xropi 1 reply 450+ views
Original Post
xropi
xropi
I wanna write a program that would run forever (in practice for some days) while optimizing some data. It has to be a w32 console application (VC6.0). The program have to be able to exit and save it''s all current data and then later read it back and continue computing when it runs again. My problem is that how can I interact with the program at runtime? I mean the following would be a good solution for me: when I push a key down, the program stop working and saves it''s data to disk and then exits. Question: how can I check whether has a key been pressed since my last check? Ropi
I'm interested in full featured 3D system development.
Basiror
Basiror
i suggest you use direct input

nehe has a good tutorial about implementation of directinput7


bool CApplication::IsKeyPressed(int key)
{
if(keyinput[key] & 0x80)
return true;
return false;
}


http://www.8ung.at/basiror/theironcross.html

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.