Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

How to read keyboard inputs from other apps?

ColacXColacX Member Posts: 141
How to read keyboard inputs from other apps or just in general?

Now the Event OnKeyDown only reads keys that is local in application so to say.

I wan't a code that can read it globally like forexample winamp can do. It will be like an Global Hotkey or like how an keylogger reads things.

Also can someone tell me how to simulate an keypressdown from the user.

This is to simulate a mouseclick. So right now im searching winuser.h

void __fastcall TForm1::Button5Click(TObject *Sender)
{
mouse_event(MOUSEEVENTF_MOVE,-500,0,0,0);
mouse_event(MOUSEEVENTF_LEFTDOWN|MOUSEEVENTF_LEFTU
P,0,0,0,0);
}

Thanks in pre-advance.
//ColacX

Comments

  • zibadianzibadian Member Posts: 6,349
    : How to read keyboard inputs from other apps or just in general?
    :
    : Now the Event OnKeyDown only reads keys that is local in application
    : so to say.
    :
    : I wan't a code that can read it globally like forexample winamp can
    : do. It will be like an Global Hotkey or like how an keylogger reads
    : things.
    :
    : Also can someone tell me how to simulate an keypressdown from the
    : user.
    :
    : This is to simulate a mouseclick. So right now im searching winuser.h
    :
    : void __fastcall TForm1::Button5Click(TObject *Sender)
    : {
    : mouse_event(MOUSEEVENTF_MOVE,-500,0,0,0);
    : mouse_event(MOUSEEVENTF_LEFTDOWN|MOUSEEVENTF_LEFTU
    : P,0,0,0,0);
    : }
    :
    : Thanks in pre-advance.
    : //ColacX
    :
    Setup a keyboard hook. Then you can see nearly all the keyboard messages, which are handled by the OS.
  • ColacXColacX Member Posts: 141
    : Setup a keyboard hook. Then you can see nearly all the keyboard
    : messages, which are handled by the OS.

    How do I do that? Please keep it simple.
    I know that if i make the program loop itself every 10 millisec I could read all keys but It doesn't seem very effective or very accurate for that mather.
Sign In or Register to comment.