PDA

View Full Version : Problem with QWSServer::sendKeyEvent, how to use it?



webquinty
4th March 2009, 14:09
Hello,

I am trying to develop a touchpad and I would like to use sendKeyEvent from class QWSServer. I have created a public slot when a press a button. The form only have a button and QLineEdit. But when I press button nothing appear in QLineEdit.


void Touchpad::press_key_0()
{

QWSServer::sendKeyEvent ( 30 , Qt::Key_0, 0, true, false );
QWSServer::sendKeyEvent ( 30 , Qt::Key_0, 0, false, false );
}

I am looking for infromation about it, but I can not find correct information.

Best reagards

webquinty
4th March 2009, 17:40
Well ,

I have found a example code of sendKeyEvent:


QWSServer::sendKeyEvent( -1, Qt::Key_0,0, true, false);
QWSServer::sendKeyEvent( -1, Qt::Key_0,0, false, false);

And now, all number works fine, but what is mean unicode = -1???
But I still have a bit problem, with the same code, I have tried with dot and minus, but it does not work.

Any advice???

augusbas
8th July 2009, 13:14
Well ,

I have found a example code of sendKeyEvent:


QWSServer::sendKeyEvent( -1, Qt::Key_0,0, true, false);
QWSServer::sendKeyEvent( -1, Qt::Key_0,0, false, false);

And now, all number works fine, but what is mean unicode = -1???
But I still have a bit problem, with the same code, I have tried with dot and minus, but it does not work.

Any advice???


Hi ,

Please can you send the code of vitual Keyboard .

I have developed a form and added Push Button to it . As A,B,C Characters and whenver the key is pressed i use the above SendKeyevent. As i studied i need to set the widget flags to WStyle_Tool and WStyle_Customize to be set. ? So that the key events are send to other window...Now how do i do that.. Please help me