![]() |
Responding to Hildon virtual keyboard keypress events
Does anyone know of a way to listen for Hildon virtual keyboard keypress events from within a Qt application? Specifically, I would like to listen for a press of the Return/Enter key when the user has finished entering text into a QLineEdit (well, my QML equivalent to be precise), so I can enable my application to respond as it does when this key is pressed on the hardware keyboard.
I'm thinking along the lines of X11/XKBlib, but I don't really know where to start with this. |
Re: Responding to Hildon virtual keyboard keypress events
There seems to be /dev/input/uinput, but it just says "read error: No such device" when I try to read it :/
|
Re: Responding to Hildon virtual keyboard keypress events
http://doc.qt.nokia.com/4.7/qwidget....eyReleaseEvent
http://doc.qt.nokia.com/4.7/qkeyevent.html Have you tried overriding the keyReleaseEvent virtual function? The following works for me in Python: Code:
class MainWindow(QMainWindow): Code:
class MyLineEdit(QLineEdit): |
Re: Responding to Hildon virtual keyboard keypress events
Oh, duh, woops, sorry. You're talking about the virtual keyboard.
And it's to fulfill my request. Doh! |
Re: Responding to Hildon virtual keyboard keypress events
Yeah, I have no problems responding to HKB key presses. I'm not aware of any Qt applications that respond to the virtual keyboard in the way I explained, otherwise I could just take a look at the source code. I guess these kinds of problems were always likely given that Qt is basically shoehorned into Maemo5. Hopefully these things will 'just work' in Harmattan and Meego CE.
|
Re: Responding to Hildon virtual keyboard keypress events
WARNING: Major Hacking Ahead
Okay, it's a two step process. Here's the first step: Sub-class QApplication and reimplement x11EventFilter like this: Code:
... Code:
Application::x11EventFilter 464 8 Code:
Application::x11EventFilter 464 8 Code:
... |
All times are GMT. The time now is 21:33. |
vBulletin® Version 3.8.8