![]() |
[WiP] Control media player with camera button when device is locked
1 Attachment(s)
Since I don't want to take my N900 out of my pocket for skipping songs I've been doing some research on how to control the media player with the camera button. I have created a patch for ShortcutD to accomplish this - grab ShortcutD 0.1.4 or later from the official repos.
Part 1 - Configuring ShortcutD This is pretty straightforward and nothing new. Simply install ShortcutD through the app manager and you'll be able to configure the camera key in a settings applet. My favorite ShortcutD configuration:
If you do not want to use ShortcutD you can also use thp's script. Part 2 - Enabling camera key when the device is locked This is a bit tricky. Sadly the camera key is being disabled when locking the device. I've already submitted an enhancment request for ShortcutD, but for now I am working on a standalone solution (hoping that this concept will soon be adopted by the ShortcutD developers). What you need:
Just install dbus-scripts and enablecambutton and the camera key should work even when the N900 is locked. To revert back to the default Maemo behaviour simply uninstall this package again. Please note: you shoud not map critical things to "Camera short press", as this action can easily be toggled by accident when the device is in your pocket. "Camera long press" is somewhat less critical. Thanks to cipper, who had the idea to use dbus-scripts instead of pynotify! - direx |
Re: [WiP] Control media player with camera button when device is locked
Thank you direx! Is the same concept applicable to the volume keys?
Is this going to replace the closed-source extended-locked-mediaplayer-control? |
Re: [WiP] Control media player with camera button when device is locked
Quote:
Quote:
|
Re: [WiP] Control media player with camera button when device is locked
Hi direx,
following the overclocking wiki page I added the file /etc/dbus-scripts.d/locked with content: /usr/local/bin/underclock * * com.nokia.mce.signal tklock_mode_ind locked and the file /usr/local/bin/underclock with content #!/bin/sh echo 0 > /sys/devices/platform/gpio-switch/cam_focus/disable so that it automatically sets to zero the flag when the device gets locked. It seems to work fine. Couldn't be this solution a simple alternative to your script? |
Re: [WiP] Control media player with camera button when device is locked
Quote:
Thanks! |
Re: [WiP] Control media player with camera button when device is locked
As I promised I updated the initial post yesterday. I am now using dbus-scripts instead of pynotify, which is definitely a better and cleaner approach.
I am not sure if this should/could go into extras. Maybe I'll add a little GUI for controlling the behavior - I don't know if this is needed, though. |
Re: [WiP] Control media player with camera button when device is locked
I know this is an old thread however I have to stick my oar in.
1. using the lock signal on dbus is silly because..what if your phone has autolock on a timeout? Potentially you could have to unlock>lock just to activate the thing! 2. Dbus scripts, while really cool is pretty heavy on cpu power, what with waking up to check every thing against it's rule set. A far better way to do this is: Code:
sudo echo 0 > /sys/devices/platform/gpio-switch/cam_focus/disable & sudo chmod 444 /sys/devices/platform/gpio-switch/cam_focus/disable |
All times are GMT. The time now is 02:39. |
vBulletin® Version 3.8.8