maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Development (https://talk.maemo.org/forumdisplay.php?f=13)
-   -   power key press event (https://talk.maemo.org/showthread.php?t=50363)

b0unc3 2010-04-18 15:22

power key press event
 
Hi,

is there any way to catch the press event of the powerkey?
I tried both with dbus and hal, but I didn't find anything useful.
Any hint?

danielwilms 2010-04-19 07:34

Re: power key press event
 
Hi,

powerlock uses HAL as far as I know. Maybe you could check that out.

Daniel

b0unc3 2010-04-19 23:04

Re: power key press event
 
Quote:

Originally Posted by danielwilms (Post 617236)
Hi,

powerlock uses HAL as far as I know. Maybe you could check that out.

Daniel

Yes, right but I was looking in the wrong way. I needed to simply add a call to libhal_ctx_set_device_condition() and all works as expected.
Thanks for your help!

thomasjfox 2011-01-27 08:20

Re: power key press event
 
Quote:

Originally Posted by b0unc3 (Post 618542)
Yes, right but I was looking in the wrong way. I needed to simply add a call to libhal_ctx_set_device_condition() and all works as expected.
Thanks for your help!

Just a quick note: libhal_ctx_set_device_condition() won't fire the callback until you have a libhal_device_add_property_watch().
This is by libhal's design as it will only add a dbus watch rule if add a property watch even if you are only interested in the "conditions".


All times are GMT. The time now is 06:48.

vBulletin® Version 3.8.8