maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Development (https://talk.maemo.org/forumdisplay.php?f=13)
-   -   Detect hw keyboard slide event (https://talk.maemo.org/showthread.php?t=62198)

Willem Liu 2010-09-13 17:55

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()));
You might also want to retrieve the value from the dbus event:
Code:

    QDBusInterface propertyInterface("org.freedesktop.Hal", QString("/org/freedesktop/Hal/devices/platform_slide"), "org.freedesktop.Hal.Device", QDBusConnection::systemBus());
    bool pressed = propertyInterface.call("GetProperty", "button.state.value").arguments().at(0).toBool();

Bool holds the value.

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