Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Send keyboard event  (Read 3780 times)

0 Members and 1 Guest are viewing this topic.

castro12321

  • Newbie
  • *
  • Posts: 4
    • View Profile
Send keyboard event
« 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.

Elgan

  • Jr. Member
  • **
  • Posts: 77
    • AOL Instant Messenger - Flat+1,+17+st+Cl
    • View Profile
Send keyboard event
« Reply #1 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"

castro12321

  • Newbie
  • *
  • Posts: 4
    • View Profile
Send keyboard event
« Reply #2 on: December 29, 2011, 04:37:47 pm »
Thanks for reply.

So SFML doesn't support it?

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Send keyboard event
« Reply #3 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 ;)
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

 

anything