![]() |
Detect hw keyboard slide event
Is there a way to receive events from the hardware keyboard when it opens and closes?
Thanks for your answer! |
Re: Detect hw keyboard slide event
yes, use the search to see how.
|
Re: Detect hw keyboard slide event
Quote:
And it's not like I haven't searched. I wouldn't have asked if I could find it. I used the keyword "keyboard", "hardware keyboard", but I couldn't find anything useful in the results. I might have overlooked it. Oh, and I forgot to mention I'm trying to do this in C++ with QtCreator. |
Re: Detect hw keyboard slide event
Hmm, lockdaemon's source code will help, keyboard slides are GPIO events.
|
Re: Detect hw keyboard slide event
Quote:
|
Re: Detect hw keyboard slide event
Quote:
Also the framing of the question could be better: like volunteering the "C++ with QtCreator" info from the start, also it would have helped to tell which search terms you used (and did you search the forum, or the API docs or general internet). Sadly you're in the minority; the forum seems overrun with people who start new threads basically just demanding to be spoon-fed information they should be able to find with a quick search. And to nitpick: you asked if it was possible, I answered the question. |
Re: Detect hw keyboard slide event
Try this
Code:
cat /sys/devices/platform/gpio-switch/slide/state |
Re: Detect hw keyboard slide event
Quote:
If we were all to answer those literally then there would only be Yes/No answers to all of them. Anyway I did forget to add some initial and crucial information like what language/sdk I'm programming in/using. For that I'm sorry. I've searched both uncle Google and the maemo.org forums with the keywords. And after a bit more searching it seems the answer might be more complicated than I initially thought it would be. |
Re: Detect hw keyboard slide event
Quote:
I'll look into that one. |
Re: Detect hw keyboard slide event
Quote:
|
Re: Detect hw keyboard slide event
Quote:
|
Re: Detect hw keyboard slide event
There should also be a dbus signal (/org/freedesktop/Hal/devices/platform_slide on Diablo) so you don't need to poll /sys unnecessarily.
|
Re: Detect hw keyboard slide event
This is for informational purposes. To monitor dbus calls live:
Code:
dbus-monitor --profile --system |
Re: Detect hw keyboard slide event
Quote:
state has changed. Than you read the value from /sys/devices/platform/gpio-switch/slide/state to see, if the slide is open or closed. regards Nicolai |
Re: Detect hw keyboard slide event
Quote:
|
Re: Detect hw keyboard slide event
In case you haven't found it already, the initial thread for lockdaemon is http://talk.maemo.org/showthread.php?t=47439
|
Re: Detect hw keyboard slide event
Quote:
|
Re: Detect hw keyboard slide event
For informational purposes. Here is a quote from an answer to the same question from the qt-interest mailing list.
Quote:
|
Re: Detect hw keyboard slide event
Quote:
ssh into the phone or run in xterm: lshal -m You should be able to see the hal events if you now slide the keyboard. You can use "libhal-dev" if you program in C. This tuttorial should help you get going: http://madison-project.wdfiles.com/l...l_Tutorial.pdf |
Re: Detect hw keyboard slide event
@fsguru
That's great info. Thanks. |
Re: Detect hw keyboard slide event
The code would look as follows:
Code:
QDBusConnection::systemBus().connect(QString("org.freedesktop.Hal"), QString("/org/freedesktop/Hal/devices/platform_slide"), QString("org.freedesktop.Hal.Device"), QString("PropertyModified"), this, SLOT(slotKeyboardSlide()));Code:
QDBusInterface propertyInterface("org.freedesktop.Hal", QString("/org/freedesktop/Hal/devices/platform_slide"), "org.freedesktop.Hal.Device", QDBusConnection::systemBus());You'll also need the following line in the .pro file: Code:
QT += dbus |
| All times are GMT. The time now is 22:10. |
vBulletin® Version 3.8.8