• Welcome to Valhalla Legends Archive.
 

Checking KeyPressed Events

Started by Networks, January 05, 2006, 05:23 PM

Previous topic - Next topic

Blaze

Quote from: rabbit on January 06, 2006, 09:55 PM
Quote from: Networks on January 06, 2006, 03:20 PM
I want the user to press a hotkey at any moment in time regardless of the program's focus and execute a certain function. For example if I am in a game and I press a hotkey I wish for my application to write a certain piece of data to a certain offset.
Ahh..your intentions are no longer hidden.

It was pretty obvious what he was doing.

Networks, use what Skywing said, RegisterHotKey it should work well.
Quote
Mitosis: Haha, Im great arent I!
hismajesty[yL]: No

Mephisto

Quote from: rabbit on January 06, 2006, 09:55 PM
Quote from: Networks on January 06, 2006, 03:20 PM
I want the user to press a hotkey at any moment in time regardless of the program's focus and execute a certain function. For example if I am in a game and I press a hotkey I wish for my application to write a certain piece of data to a certain offset.
Ahh..your intentions are no longer hidden.

Quote from: Mephisto on January 06, 2006, 03:01 PM
Quote from: rabbit on January 05, 2006, 10:07 PM
The conio library has a getch() function, which does exactly what you want.
Eh..that was before I knew he wanted to catch regardless of focus.

It wouldn't matter if he wanted it in focus anyways.  getch() would require his program to constantly be avaliable to accept user input into a buffer which is certainly not what he wanted anyways, whether the program would be in focus or not.