SFML community forums

Help => System => Topic started by: castro12321 on December 29, 2011, 03:12:33 pm

Title: Send keyboard event
Post by: castro12321 on December 29, 2011, 03:12:33 pm
Is it possible to send keyboard event to other programs?

If i press ctrl+num1 it should write "hello" in notepad.exe or something like that...

Thanks.
Title: Send keyboard event
Post by: Elgan on December 29, 2011, 03:49:37 pm
inteface the windows api and use sendmessage

something like;

Hwnd Hwnd;

Hwnd = findwindow (notepad, Classnamenotepad

THen you get the children , i forget, enum children or then use findwindowEx to ge tthe editbox

hw  = findwindowEx(hwnd, editboxclass)

then sendmessage(hw , "text'. CONST_FOR_WRITING);


just google "sendmessage notepad example"
Title: Send keyboard event
Post by: castro12321 on December 29, 2011, 04:37:47 pm
Thanks for reply.

So SFML doesn't support it?
Title: Send keyboard event
Post by: Nexus on December 29, 2011, 05:03:03 pm
Quote from: "castro12321"
So SFML doesn't support it?
No, with SFML you can't open other applications. It's a multimedia library ;)