Device Virtual Keyboard
-
Hi.
Does anybody know of a way to bring up the devices virtual keyboard.
Thanks. -
What devices exactly? Common mobile devices or specific embedded?
-
Common mobile. Symbian/MeeGo
-
Not sure about symbian/meego (still can't compile app for symbian, hehe), but I thought that it should be done automatically when needed. At android-lighthouse week ago or so keyboard autoopening added too.
-
Have you tried raising a RequestSoftwareInputPanel event?
-
Well the thing is I need to make my own GUI element that would get some input from the user via the virtual keyboard.
Thanks Fuzzbender I think posting this event might be the right way to go.
-
I now have the virtual keyboard displaying(I have a QLineEdit subclass in a QGraphicsProxyWidget) and it works nicely. But however I need to react to the virtual keyboard being closed and I cant seem to get the QEvent::CloseSoftwareInputPanel event. I even installed an application wide event filter.
-
I got this one working, but it took one of the dirties hacks I had to ever use with Qt(and I'm not pleased with it because it might lead to some bugs). Basically what I've done is I have reimplemented the mousePressEvent mouseReleaseEvent and paintEvent with the following.
@void MyClass::mousePressEvent(QMouseEvent *event)
{
QLineEdit::mousePressEvent(event);
//setup some variables I need for painting
}
@@void MyClass::mouseReleaseEvent(QMouseEvent *event)
{
//Hack Forcing the Virtual keyboard
QLineEdit::mouseReleaseEvent(event);
QLineEdit::mousePressEvent(event);
QLineEdit::mouseReleaseEvent(event);
//----------------------------------------------------------------------------------------------
isEditing = true;
//setup some variables I need for painting
}@@void MyClass::paintEvent(QPaintEvent *)
{
//painting
//if Editing the update will be called after the input is hidden
if(isEditing)
timer->start();//A single shot timer triggering what I need to do
}
@As I have stated I'm not pleased with this. I had to make an assumption that a paintEvent will be called only after the virtual gets hidden (this happens to be the case on my Nokia 5800 and hopefully it won't blow up in my face on other devices). The application gets locked in portrait mode so fortunately rotations aren't a concern. But please If anyone knows of a better way of learning that the virtual keyboard has been hidden please let me know. I think that me not getting the CloseSoftwareInputPanel event might have something to do with the fact that I'm working with a widget embedded in QGraphicsView.
"QTBUG-8866":http://bugreports.qt.nokia.com/browse/QTBUG-8866?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
-
[quote author="infotorpk" date="1415955181"]hi,
if i am using it for embedded,how can i brings up the virtual keyboard?FYI:
I am running ubuntu on my embedded device.[/quote]Build the virtual keyboard by yourself (Or plenty of ready made solutions in internet, download and customize as per your embedded device display size)
On line edit clicked, show your virtual keyboard. On "Done", hide the keyboard.
-
[quote author="infotorpk" date="1415955181"]hi,
if i am using it for embedded,how can i brings up the virtual keyboard?FYI:
I am running ubuntu on my embedded device.[/quote]Build the virtual keyboard by yourself (Or plenty of ready made solutions in internet, download and customize as per your embedded device display size)
On line edit clicked, show your virtual keyboard. On "Done", hide the keyboard.