Friday, July 31, 2009

Executing keystrokes using TC?

hi...





basically i am more in to electronics stuff.. but for i need to use Turbo C for a project of mine... a part of my project includes executing key strokes using c...





suppose i want to press the key F1....





i wan t to wirte a program in which i will copy the scan codes of the particular key ( F1 here, down stroke = 3B, up stroke = BB in hex values)


to the keyboard port .. which i am not sure coz i have confusion between 60 and 64h..... using outport command....


i have kept F1 as a global hotkey to change the track in winamp.. so if it gets executed the track should change.. but unfortunately its not working.. maybe the syntax is wrong...or the logic??....





will this logic serve my purpose ??..... i am not sure of syntax too... can anyone pls help me with this...








thanks in advance.....

Executing keystrokes using TC?
Ok, I'm going to make the assumption here that you have a Windows OS of some kind running. Good news is that it isn't your program, bad news is that you CANNOT intercept a keystroke that way and send it to another Windows application (the aforementioned Winamp, for example) because all Win32 applications get their messages from Windows ques. You have to write a Win32 compatible program in order to access these ques to message Winamp. Better to try and trap some character value directly in your program, assuming it is a regular old DOS console that you're doing. As far as I know, Turbo C versions less than 3.X don't support any flavor of Windows directly. The URL below has a good tutorial on Win32 stuff, so if your compiler can do it, you can too.


No comments:

Post a Comment