![]() |
[Anounce] [N9] Volume/Power Button Monitor
Add actions to volume/power/proximitySensor from lockscreen, camera, and other apps.
N9 Button Monitor | mt-toggle for n9bm Highlights:
Features:
Installation: dpkg --force-depends -i n9-button-monitor_*.deb #force-depends installs dependencies, like apt-get -f install https://github.com/teleshoes/n9-button-monitor config file is located at /home/user/.config/n9-button-monitor.conf Default Config {this gets created if there is no file} feel generous? http://api.flattr.com/button/flattr-badge-large.png {or send money via paypal to elliot.wolk@gmail.com} |
Re: [Anounce] [N9] Volume/Power Button Monitor
you need to define your own getActions() function.
heres an example that does the camerra hack {vol+ to take pictures in camera app} and play/pauses music using mplayer Code:
def getActions(): |
Re: [Anounce] [N9] Volume/Power Button Monitor
v0.1
Code:
#!/usr/bin/python |
Re: [Anounce] [N9] Volume/Power Button Monitor
i put the above script in /usr/bin/n9-button-monitor, chmod +x.
i run it on startup with upstart. /etc/init/n9-button-monitor.conf Code:
# Description of the script, mandatory |
Re: [Anounce] [N9] Volume/Power Button Monitor
Thanks for sharing, I have to think on how I can used this for my wife's N9.
|
Re: [Anounce] [N9] Volume/Power Button Monitor
Cool!
Any aims for this? GUI maybe? |
Re: [Anounce] [N9] Volume/Power Button Monitor
Quote:
1) investigating consuming button presses, overriding the default button actions like zooming/volume when an action is defined in the script. {or maybe just overriding it period in all cases, and simulating all the actually useful ones with actions in the script} 2) making the volume keep the phone's ringer volume and speaker volume in lockstep. so many times ive turned down the vol only to have loud music blast out of it. what id do is make it so that every time you press a volume button, ill get the ringer volume and set the phone volume to some variation on that. 3) separating out the action configuration from the script, so you dont need to be a python developer to use it. i imagine a simple rc file a la ~/.n9-button-monitor [volume-up-press] screen_lock = start_music camera_on_top = snap_picture [volume-up-release] always = sync_volume i would need to find out what people would even want to use this for, and add all of them to the rc-file grammar. 4) implement state for macro-ish controls e.g.: make it so pressing and holding volume up, and then pressing volume down, and then releasing volume down and then releasing volume up, turned on the flashlight for 20 seconds "UP DOWN down up" => "flashlight on; sleep 20; flashlight off" {i think im going to rename the vol+/vol- keys INC and DEC to avoid confusion with button-up and button-down for keypresses.} |
Re: [Anounce] [N9] Volume/Power Button Monitor
Quote:
1) play/pause/skip/prev music players on the lock-screen 2) flashlight on/off on the lock-screen 3) camera take picture {and maybe focus first} 4) camera take delayed picture 5) answer calls, instead of swiping up 1, 3, and 4 are easy and done. the camera doesnt focus first though, so what id REALLY like to do is make it so volUp-PRESS focuses, and volUp-RELEASE snaps. i dont think i have enough control to do this, though. if anybody thinks of anything even remotely awesome, please post. |
Re: [Anounce] [N9] Volume/Power Button Monitor
i got torch/flashlight toggling to work from the lowpowerscreen.
|
Re: [Anounce] [N9] Volume/Power Button Monitor
Quote:
|
Re: [Anounce] [N9] Volume/Power Button Monitor
Quote:
|
Re: [Anounce] [N9] Volume/Power Button Monitor
Quote:
|
Re: [Anounce] [N9] Volume/Power Button Monitor
Quote:
|
Re: [Anounce] [N9] Volume/Power Button Monitor
the relevant line in the code is:
, Action([voldn, volup, volup], cond=screenLocked, action=torch.toggle) i.e.: press and hold volume down, double-tap volume up, and torch is toggled |
Re: [Anounce] [N9] Volume/Power Button Monitor
this is great!
thank you for sharing! could anyone (if the author is focused on more principal things) write a tutorial or how-to use this finding? I understand the potential of the script, but don't really know how to use it. shall I just write everything in the terminal? please help, as the default buttons are just useless!!! many thanks for your work! |
Re: [Anounce] [N9] Volume/Power Button Monitor
What would be cool is pressing and holding button X
1) unlock 2) launch camera 3) focus 4) snap a photo Similar to how the hardware camera button on the Lumia 800 functions. |
Re: [Anounce] [N9] Volume/Power Button Monitor
Quote:
ill see if i can put together something you can just run from the terminal and have it work. some questions first {anyone else, feel free to chime in}: 1) which of these sounds better for the flashlight/torch on lowpower lock screen? a) vol+ toggles the torch b) vol+ will toggle the flashlight {it will turn off after 30s} c) press and hold vol+ to turn on the flash, release to turn it off d) press and hold vol+, double-tap vol-, release vol+, to toggle the flash {this makes it more or less impossible to pocket-flash} 2) i dont know if anyone else cares about the music play/pause/skip/prev, but to me thats the vital feature. how should this work/not work? 3) also, should it simulate thomas perl's camerra hack? {vol+ to take picture when in camera mode} ive found that i like it. 4) does anyone care about 10s delayed picture? its more or less impossible to take a good picture without holding the n9 anyway, so it seems fairly useless to me so far. |
Re: [Anounce] [N9] Volume/Power Button Monitor
Quote:
totally feasible, except for the focusing bit. the built-in camera doesnt expose any way to forcibly make it focus {that i know about}. one could easily just write another camera application for doing this with qt mobility, but it wouldnt be as full-featured or polished. |
Re: [Anounce] [N9] Volume/Power Button Monitor
one thing ive been thinking about is simply snapping pictures from the lock screen, with no viewfinder. extremely often i find that im not quick enough to unlock my phone, open up the camera app, and actually snap one off before the phenomenon im trying to capture stops.
the way i imagine this would work is to press and hold vol+ from the lock screen, and then tap vol- repeatedly to snap off pix. i would use the qtmobility framework for this, too, which i havent tested. it seems that it borrows the settings from the camera app already, which should be convenient. does this sound useful to anybody? |
Re: [Anounce] [N9] Volume/Power Button Monitor
Yes, I would like to have that option.
|
Re: [Anounce] [N9] Volume/Power Button Monitor
this is really getting interesting
i think it would be in perfect order if: 1-long press on power button when on stand by turns on flash light and off when short press after that 2-short press on power button unlocks the device. 3- when camera is opened use power button for shooting with focus 4- when player is opened power button for pause and resume and volume button + for next track when short pressed and forward when long pressed, volume button - previous track when short pressed and rewind when long pressed. guess for the camera shooting from stand by screen it could be double press on power button or something ? if we could all agree on a pattern for the buttons then a dep file could be made with that pattern code and uploaded to the store so all N9 users could enjoy it and even for profit to who ever would like to make it :) |
Re: [Anounce] [N9] Volume/Power Button Monitor
Quote:
The entire idea revolves around one handed operation... while cycling in my case. Trying to find the shutter button on screen, holding it down, and waiting for it to focus before releasing tends to be very difficult :D |
Re: [Anounce] [N9] Volume/Power Button Monitor
Quote:
|
Re: [Anounce] [N9] Volume/Power Button Monitor
Quote:
also, i really wanna know what buttons people want, but no consensus need be reached; it should be configurable {preferably without coding}. |
Re: [Anounce] [N9] Volume/Power Button Monitor
I would suggest:
1 - c) press and hold vol+ to turn on the flash, release to turn it off 2 - double tap on + to next, double tap on - for previous. press both together for pause (is it possible? physically yes) 4 - camerra hack is extremely slow for me to use, really. need to find out something more quick. toggling camera from lockscreen is a good ideal |
Re: [Anounce] [N9] Volume/Power Button Monitor
Can you also change the Vol up and the Vol down button to force the volume instead of changing the profile?
It's very annoying, see this bug what I mean: http://forum.meego.com/showthread.php?t=5202 https://harmattan-bugs.nokia.com/show_bug.cgi?id=210 |
Re: [Anounce] [N9] Volume/Power Button Monitor
Quote:
1. exactly like yours, the best option for flashlight imo 2. Agreed too. Double tap vol+/- next/prev sounds good, but pause... it's hard to push both exactly same time. If not possible, its ok. i rarely use the pause option and it isn't so bad to do it on the usual way. 3. hold down vol- for camera use. possibility to open camera app, focus and take a picture. Of course the best option would be possibility to choose by yourself one command for one action with UI. Like this: A. flashlight: choose option (1.long press vol+-, 2.double press vol,3.... etc) B. next/previous track: 1...2...3. |
Re: [Anounce] [N9] Volume/Power Button Monitor
have you tried to push both buttons at once? :) I am doing it right now, it is not a problem.
|
Re: [Anounce] [N9] Volume/Power Button Monitor
Quote:
|
Re: [Anounce] [N9] Volume/Power Button Monitor
Quote:
|
Re: [Anounce] [N9] Volume/Power Button Monitor
ok, so here is my plan for the next release, based on the enormously helpful feedback and my own experiments.
this will be the first one that will work out of the box {maybe just for inception-users and open-moders, but ill do my best to make it work for anybody that can use a terminal and follow instructions in it once}. goals: 1) make installation easy, with an incept-able or just straight up installable deb. apply for ovi store, etc. 2) move the button config to a file {e.g.: /home/user/.config/button-monitor/keys.conf}. it will be configurable live at runtime. 3) make the buttons you can configure reasonable. there will be 5 events per button. {for now, just volume up, and volume down; power down is right out, until i work out how to both disable the default action, and ensure that you can still shut down the phone and lock it safely. also out are multi-button combinations, because i think they are too hard to do usefully, and complicate the detection of patterns; in my tests, i wound up doing things i didnt mean most of the time.} (a) press-and-hold-start (b) press-and-hold-release (c) click (d) double-click (e) treble-click for example: -press-hold-start VOL+ might focus the camera, and press-and-hold-release VOL+ take the picture -press-hold-start VOL- might turn on the flash, and press-and-hold-release VOL- turn it back off -click VOL+ would play/pause music, double-click VOL+ would next song, and treble-click VOL+ would prev song 4) add some actions (a) flash on, with configurable auto-shutoff {ready} (b) flash off {ready} (c) snap picture inside the camera program {ready} (d) focus camera inside the camera program {ready} (e) snap picture without camera program {possible, but nowhere near ready, not essential for next release} (f) volume control, not ****ing profile {havent explored it yet, i think this is critical and should be simple} (h) play/pause music {i use magic perl scripts + mplayer, so not done yet for anybody but me} (i) skip song {ditto} (j) prev song {ditto} 5) add some conditions. you can specify a list of them. (a) lock screen is on/off {ready} (b) low power screen is on/off {ready} (c) phone is/is not in-pocket screen-off {might be impossible; PLEASE LET ME KNOW IF YOU KNOW HOW TO DO THIS there are no mce dbus messages for it, anyway, and the brightness device doesnt stop reading 0 in lowpowerscreen} (d) camera program has focus {ready} (e) generic program is on top {ready, but you need to know the window name; camera is camera-ui, firefox is fennec, etc} ill put the features in a wiki or list or something, and post when theyre done |
Re: [Anounce] [N9] Volume/Power Button Monitor
features im adding:
https://teleshoes.tadalist.com/lists/2175153/public this is to show that progress is just slow, not dead; im on my way to making something useful. complain here and ill see it. propose any actions or conditions you may think of here, and ill add them if they make sense. |
Re: [Anounce] [N9] Volume/Power Button Monitor
Quote:
From the todo list: action: volumeUp {not profile} action: volumeDown {not profile} Please put this one the highest priority on the list.. :( You will make A LOT of users happy with this very functional option! |
Re: [Anounce] [N9] Volume/Power Button Monitor
Quote:
however, i dreamt up a compromise; sync the profile to the volume after each press. SILENT => 0% BEEP => 0% RINGING_1 => 25% RINGING_2 => 50% RINGING_3 => 75% RINGING_4 => 100% lemme know if you think this makes sense as a compromise if actually selectively disabling default actions {like zoom in the browser, zoom in the camera, etc} is hard or even impossible. |
Re: [Anounce] [N9] Volume/Power Button Monitor
Quote:
Hmmm... You could try that as a workaround for now. I only want a vibrate profile though. I think I might have a solution for that: I will make a special ringtone that is silent, but it will vibrate longer by default (because if you set the ringtone on "(no sound)" it will only vibrate very short). About zooming on browser: Pinch to zoom About camera zooming: on the camera app, there is a slider at the top, you can slide that to zoom in or to zoom out. so the Volume button is only meant for the Volume! (and to boot NITDroid :p ) |
Re: [Anounce] [N9] Volume/Power Button Monitor
Quote:
until i find a way to not eat the events under certain circumstances, i cant really make this feature work. |
Re: [Anounce] [N9] Volume/Power Button Monitor
Quote:
|
Re: [Anounce] [N9] Volume/Power Button Monitor
0.3 should actually work, full of bugs, but otherwise pretty much exactly as advertised, if youre terminal savvy enough to get it working. {if you have any trouble installing it, ill try to help; ask here or on irc}
key features are missing, like music-control and HtheB-style-volume-control, and its a ***** to install and run because it needs super-privileges. also, i just got it working so its not especially well-tested. it seems to use no power at all when idle, which is my #1 priority in terms of regression testing. if you get it working, and notice power usage increases, PLEASE TELL ME. |
Re: [Anounce] [N9] Volume/Power Button Monitor
0.4 => music suite actions
action=musicPlayPause,volumeUp,singleClick,screenL ocked action=musicNext,volumeDown,singleClick,screenLock ed action=musicPrev,volumeDown,doubleClick,screenLock ed |
Re: [Anounce] [N9] Volume/Power Button Monitor
I CANT FIGURE OUT HOW TO CHANGE THE GODDAM SYSTEM VOLUME.
tried with built-in clis: pulseaudio-utils, alsamixer, amixer tried with c libraries and all audio APIs i found in the developer api: qmediaplayer, phonon.audiooutput. this should SO not be difficult. anybody know how to do this? {programmatically adjust the system volume, such that the slider in the status bar also moves with it} |
All times are GMT. The time now is 09:12. |
vBulletin® Version 3.8.8