Active Topics

 


Reply
Thread Tools
Posts: 239 | Thanked: 194 times | Joined on Jul 2010 @ Amsterdam
#11
Originally Posted by MohammadAG View Post
That's not exactly an event though is it, it requires you to poll the file instead of listening to the keyboard slides.
MohammadAG, hmm yes that's quite a drawback. I'll have to study lockdaemons source code to see if there is any dbus calls used there which receives the signal from the keyboard.
 
Posts: 2,802 | Thanked: 4,491 times | Joined on Nov 2007
#12
There should also be a dbus signal (/org/freedesktop/Hal/devices/platform_slide on Diablo) so you don't need to poll /sys unnecessarily.
 

The Following User Says Thank You to lma For This Useful Post:
Posts: 239 | Thanked: 194 times | Joined on Jul 2010 @ Amsterdam
#13
This is for informational purposes. To monitor dbus calls live:

Code:
dbus-monitor --profile --system
Just to have all the related information in one place.
 
nicolai's Avatar
Posts: 1,637 | Thanked: 4,424 times | Joined on Apr 2009 @ Germany
#14
Originally Posted by Willem Liu View Post
MohammadAG, hmm yes that's quite a drawback. I'll have to study lockdaemons source code to see if there is any dbus calls used there which receives the signal from the keyboard.
You should listen for the dbus event, which only tells you the
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
 

The Following User Says Thank You to nicolai For This Useful Post:
Posts: 239 | Thanked: 194 times | Joined on Jul 2010 @ Amsterdam
#15
Originally Posted by nicolai View Post
You should listen for the dbus event, which only tells you the
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
Thanks! That's good to know. It would've been great if the dbus event would've carried that information with it, but I suppose I can't have it all.
 
pelago's Avatar
Posts: 2,121 | Thanked: 1,540 times | Joined on Mar 2008 @ Oxford, UK
#16
In case you haven't found it already, the initial thread for lockdaemon is http://talk.maemo.org/showthread.php?t=47439
 

The Following 2 Users Say Thank You to pelago For This Useful Post:
Posts: 239 | Thanked: 194 times | Joined on Jul 2010 @ Amsterdam
#17
Originally Posted by pelago View Post
In case you haven't found it already, the initial thread for lockdaemon is http://talk.maemo.org/showthread.php?t=47439
Thanks. I did find it, but it's good to have that link here as well.
 
Posts: 239 | Thanked: 194 times | Joined on Jul 2010 @ Amsterdam
#18
For informational purposes. Here is a quote from an answer to the same question from the qt-interest mailing list.

You can try MCE Dbus Interface. Something like:

QDBusConnection::systemBus().connect(MCE_SERVICE, MCE_SIGNAL_PATH, MCE_SIGNAL_IF, MCE_TKLOCK_MODE_SIG, this, SLOT(onTKLockModeChanged(QString)));

Where onTKLockModeChanged is a simple slot method.

Last edited by Willem Liu; 2010-09-13 at 17:55.
 
Posts: 1 | Thanked: 1 time | Joined on Sep 2010
#19
Originally Posted by Willem Liu View Post
Thanks. I did find it, but it's good to have that link here as well.
You can use the "hal" infrastructure.

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
 

The Following User Says Thank You to fsguru For This Useful Post:
Posts: 239 | Thanked: 194 times | Joined on Jul 2010 @ Amsterdam
#20
@fsguru

That's great info. Thanks.
 
Reply


 
Forum Jump


All times are GMT. The time now is 17:40.