maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Applications (https://talk.maemo.org/forumdisplay.php?f=41)
-   -   [BETA RELEASE] PhoneME Advanced (Java Mobile) (https://talk.maemo.org/showthread.php?t=81969)

wook_sf 2012-06-18 12:59

Re: [BETA RELEASE] PhoneME Advanced (Java Mobile)
 
Quote:

Originally Posted by DavyP (Post 1223665)
Without a real N9, this is a tough one for me to fix. I applied for a
N9 with the Summer 2012 Device Program and my submission
got accepted, but there are still a few hurdles to cross before I will
get the device.

OTOH, if someone can tell me how I can programmatically pop up
the native virtual keyboard and intercept its event, that would help
too.

The problem is that I do not use native Qt input widgets, and many
examples seem to put an input widget somewhere off the screen
and intercept its events. However, I could not get this to work on
the N9 emulator.

Davy

seems like QT input widget is only proper solution :S
there's dev's around globe who might help you, i hope...i am just not right guy for QT :S damn
i can test though...
i hope you will get that device as soon as possible

DavyP 2012-06-25 16:54

Re: [BETA RELEASE] PhoneME Advanced (Java Mobile)
 
Quote:

Originally Posted by wook_sf (Post 1223670)
seems like QT input widget is only proper solution :S
there's dev's around globe who might help you, i hope...i am just not right guy for QT :S damn
i can test though...
i hope you will get that device as soon as possible

It turns out that triggering the virtual keyboard is a bit harder than I thought.

I implemented a simple app with a textfield (subclassing QLineEdit), but even after posting QEvent::RequestSoftwareInputPanel events and faking mouse press/release events, I cannot get the virtual keyboard to automatically pop up. The user still has to tap the widget, so I cannot hide it by putting it somewhere off the screen.

WinCE and Android had proper APIs to handle the keyboard. With Maemo, it seems I have to reimplement my own keyboard.

Davy

wook_sf 2012-06-25 17:32

Re: [BETA RELEASE] PhoneME Advanced (Java Mobile)
 
Quote:

Originally Posted by DavyP (Post 1227211)
It turns out that triggering the virtual keyboard is a bit harder than I thought.

I implemented a simple app with a textfield (subclassing QLineEdit), but even after posting QEvent::RequestSoftwareInputPanel events and faking mouse press/release events, I cannot get the virtual keyboard to automatically pop up. The user still has to tap the widget, so I cannot hide it by putting it somewhere off the screen.

WinCE and Android had proper APIs to handle the keyboard. With Maemo, it seems I have to reimplement my own keyboard.

Davy

nokia always liked to mess with apis...always
will reimplementation be good enough?

rainisto 2012-06-25 17:49

Re: [BETA RELEASE] PhoneME Advanced (Java Mobile)
 
Quote:

Originally Posted by DavyP (Post 1227211)
It turns out that triggering the virtual keyboard is a bit harder than I thought.

I implemented a simple app with a textfield (subclassing QLineEdit), but even after posting QEvent::RequestSoftwareInputPanel events and faking mouse press/release events, I cannot get the virtual keyboard to automatically pop up. The user still has to tap the widget, so I cannot hide it by putting it somewhere off the screen.

WinCE and Android had proper APIs to handle the keyboard. With Maemo, it seems I have to reimplement my own keyboard.

Davy

You should be able to 'hide' it if you programatically set focus to qlinedit. http://stackoverflow.com/questions/5...it-focus-in-qt

freemangordon 2012-06-25 18:16

Re: [BETA RELEASE] PhoneME Advanced (Java Mobile)
 
Quote:

Originally Posted by DavyP (Post 1227211)
It turns out that triggering the virtual keyboard is a bit harder than I thought.

I implemented a simple app with a textfield (subclassing QLineEdit), but even after posting QEvent::RequestSoftwareInputPanel events and faking mouse press/release events, I cannot get the virtual keyboard to automatically pop up. The user still has to tap the widget, so I cannot hide it by putting it somewhere off the screen.

WinCE and Android had proper APIs to handle the keyboard. With Maemo, it seems I have to reimplement my own keyboard.

Davy

There is a way AFAIK, look at void MozQWidget::showVKB() here

DavyP 2012-06-25 19:17

Re: [BETA RELEASE] PhoneME Advanced (Java Mobile)
 
Quote:

Originally Posted by rainisto (Post 1227225)
You should be able to 'hide' it if you programatically set focus to qlinedit. http://stackoverflow.com/questions/5...it-focus-in-qt

Thanks for the tip, but I already tried this before and it does not
work.

The example shows the QLineEdit and the widget has focus, but the virtual keyboard does not pop up. I still have to tap on the widget to
trigger it (tested on N900).

Davy

DavyP 2012-06-25 19:46

Re: [BETA RELEASE] PhoneME Advanced (Java Mobile)
 
Quote:

Originally Posted by freemangordon (Post 1227242)
There is a way AFAIK, look at void MozQWidget::showVKB() here

Thanks. I figured out what went wrong. Even though I called setFocus, the widget did not have focus yet when posted the RequestSoftwareInputPanel event. I made some progress.

Davy

freemangordon 2012-06-25 19:50

Re: [BETA RELEASE] PhoneME Advanced (Java Mobile)
 
Quote:

Originally Posted by DavyP (Post 1227286)
Thanks. I figured out what went wrong. Even though I called setFocus, the widget did not have focus yet when posted the RequestSoftwareInputPanel event. I made some progress.

Davy

Yeah, apparently the QTimer::singleShot ugly hack workarounds that

DavyP 2012-06-25 21:24

Re: [BETA RELEASE] PhoneME Advanced (Java Mobile)
 
Quote:

Originally Posted by freemangordon (Post 1227287)
Yeah, apparently the QTimer::singleShot ugly hack workarounds that

Yes, I got it working now.

My next problem is that the virtual keyboard does not produce any KeyPress events (physical keyboard does produce them on the N900). The textChanged/textEdited signals of QLineEdit are not that
useful to identify which key was pressed. Seems like I have to mess
around with some X11 events.

Davy

freemangordon 2012-06-25 22:02

Re: [BETA RELEASE] PhoneME Advanced (Java Mobile)
 
Quote:

Originally Posted by DavyP (Post 1227303)
Yes, I got it working now.

My next problem is that the virtual keyboard does not produce any KeyPress events (physical keyboard does produce them on the N900). The textChanged/textEdited signals of QLineEdit are not that
useful to identify which key was pressed. Seems like I have to mess
around with some X11 events.

Davy

Look through the whole file I sent the link to, this is a part of Qt backend of fennec 16a1, you should do almost the same thing fennec does


All times are GMT. The time now is 20:35.

vBulletin® Version 3.8.8