PDA

View Full Version : how to open a keyboard...?



sar_van81
20th December 2006, 06:02
hi...

can anyone say me how to use the function QWSServer::openKeyboard();
.i used it in a function as follows:


void keyclass::keyboardopen()
{
QWSServer::openKeyboard();
}
.

it showed me th following error:
"error: cannot call member function ‘void QWSServer::openKeyboard()’ without object".
is this the right way to use it...?else how to use this...?


(hey i did not put the smilies in-between,the notation for "colon and o" is that.dont mistake me..)
thanks in advance...

munna
20th December 2006, 06:25
openKeyboard is not a static member function of the class QWSServer and therefore you cannot call it like this




QWSServer::openKeyborad()//Wrong



You will first need to create an object of QWSServer and then access the function using that object. Something like




QWSServer wsServer;
wsServer.openKeyboard();



Also, access to the QWSServer instance can be obtained using the global qwsServer pointer. So you can use something like




qwsServer->openKeyboard();

sar_van81
20th December 2006, 13:13
hi..

thank you for the suggestion.i used and compiled it without any errors. but still need some clarifications. actually i need to develop a virtual keyboard like application. for that should i require to use this function and the QWSServer::setKeyboardHandler ( QWSKeyboardHandler * kh ). if yes then what is the parameter that i need to pass for the" kh" in this function...?Also how to test this whether our it has openned the device...?


i had designed the keyboard with pushbuttons and when they are clicked i'l use the sendKeyEvent to send the key codes. i have a textedit in the same widget above the pushbuttons. so when user presses the pushbuttons, the letters corresponding to the unicodes are displayed in the textedit box. can anyone how is this mapped to the kernel from sendKeyEvent function...? i traced the function but could not get where its being given to the kernel ...i think i'm missing some more that i dont konw.

can anyone give me suggesstions or solutions for this...?