PDA

View Full Version : like virtual keyboard?



triperzonak
9th July 2008, 08:33
hi,
im using qt in windows

i am creating a bot program,

i would like to send a keypress signal to "my computer" (outside the program) like the keyboard is virtually press,

how can i do this??

mchara
9th July 2008, 10:05
Hi,
I suppose qt is not able to do that.

U should use
SendMessage(WM_KEYDOWN /WM_CHAR/ WM_KEYUP
look at msdn because it's winApi method.

Be advised that using winApi breaks portability of your app.

triperzonak
9th July 2008, 16:49
tnx i know sendkey() but like what you said it is only for windows im looking for crossplatform qt/c++ code..

then if qt dont have it maybe c++ has?

triperzonak
10th July 2008, 04:31
if im going to make my project work in cross platform,

what is the equivalent of sendkey() from windows in linux..

like send keystrokes?

examples are much appreciated..

tnx
trip

pherthyl
10th July 2008, 16:42
Have a look at this. When I wrote it 2 years ago it worked.
http://websvn.kde.org/trunk/playground/accessibility/nokey/util.cpp?view=markup