Can I set Tasker to send SMS to a predefined number with a predefined text when I press 4 times on volume-up while my phone is screen on but lockscreen (with pattern)? Also, the command must be canceled if 2 seconds have passed since the last volume up key action (for example, in case I used it for simply volume-up music). That means to trigger command, I must press again 4 times quickly.
Who can help me?
Dear @VALYYYY
The tasker can't detect the volume button presses.
If you are willing to use another app.
Check the app called QuickClick in Play store by "Blor" developer.
The other way around is to make tasker detect the volume changes (4 consecutive increase/decrease).
Related
Hi,
another question (seems I'm diving deeper and deeper into Windows Mobile...): Is it possible to capture the VK_OFF button event for, e.g., disabling powering off the device?
I've already managed to set a hook (SetWindowsHookEx(WH_KEYBOARD_LL,...) and to define a callback function that is called whenever a low-level keyboard event occurs. Thus, I can manage to capture various hardware buttons of the device, but the power off button does not cause the callback function to be called at all.
I'm programming a HTC ARTEMIS, using MS visual Studio 2005 (native c++)
Regards,
Günther
You can also get a notification about power(RequestPowerNotifications) and you can prevent power off I think.
You need disable power toggle or use power button?
o.k., I'm now able to receive power notifications. What I want is the following: There is a running thread from my application that reads out GPS data and sends them over GPRS to a remote serve.
When the device goes to suspend state, these tasks also stop - and this I'd like to avoid. Do you think I can work with SetPowerRequirement()? But for which devices would I have to manually set the power requirement, and how are they named?
Or what to do when the Message Queue receives a notification from RequestPowerNotification? (Moreover, it seems that when the Suspend-notification arrives, the watching thread has already been suspended and does not do any more action...)
http://htc-devs.com/forum/index.php?topic=158.0
Thanks, that was a great site - so I understand that it is not possible to intercept power button pressed before the OS gets notified and takes an action
But I think, I could implement a workaround as follows:
1. Requesting power notifications
2. When a notification arrives, immediately SetSystemPowerState() to POWER_ON (without checking the type of notification as this obviously could not be done before the system goes into suspend mode)
3. Process all messages in message queue (in order to prevent from getting into an infinite loop)
4. Wait for next power notification (goto 2.)
I want to assign "lock device and screen off" to "hold down red (hangup) button". I have tried a couple of different ways but whenever I press and hold it to indicate to the key control app what button I want to define, it just goes to the quickmenu choices for shutdown - it doesn't capture it at all. Is there any way to do this? Alternatively it would be great to just have it default to lock device and turn screen off (like it used to do) when I hold down the hangup button. Something made that behavior change recently and I can't figure out how to set it back.
Mike
/edit: this guide is now obsolete because Xposed Additions now has button remapping with some advanced options, which also seem to enable volume wake on my HTC One
If you hate locking and unlocking your HTC One with the Power button, you can change that quite easily int for example Volume Down.
ButtonRemapper would be the easiest method, but it doesn't work with the HTC One. It doesn't load the correct file.
The solution: simply edit the correct file
Code:
keypad_8960.kl
found in
Code:
/system/urs/keylayout/
by hand (I used Fx File Explorer with the paid Root plugin) and reboot your phone. My edited file is attached on this post.
Original:
Code:
key 116 POWER WAKE_DROPPED
key 114 VOLUME_DOWN WAKE
key 115 VOLUME_UP WAKE
key 107 ENDCALL WAKE_DROPPED
My current file that switches the Volume Down and Power button:
Code:
key 116 VOLUME_DOWN WAKE
key 114 POWER WAKE_DROPPED
key 115 VOLUME_UP WAKE
key 107 ENDCALL WAKE_DROPPED
I don't know if the same file is used on different ROMs. I tested this on the P.A.C. Man ROM.
Now waking my One is a breeze! :laugh:
P.S. You may need the following workaround to fix the 'volume wake not working' bug present in some (or all?) JB ROMs, which strangely also affects this tweak (symptom: volume down won't wake phone sometimes).
1. Install Xposed Framework (which you should anyway, it's awesome)
2. Install MoDaCo Toolkit
3. Wait for the annoying ad (Paul, tsk, tsk) and enable the option 'HTC One > Enable Volume Wake'
4. Enable MoDaCo Toolkit in Xposed
5. Reboot
6. Profit ^_^
Is there a way to remap volume keys to change song when double clicked or something?
dare2k said:
Is there a way to remap volume keys to change song when double clicked or something?
Click to expand...
Click to collapse
I'm not sure, but when there is, I think it's not done with this or another .kl file but with a 'ROM tweak', like AOKP settings.
But remapping it that way does it mean if you want to lower the volume you press the power button?
Sent from my HTC One using Tapatalk 2
baste07 said:
But remapping it that way does it mean if you want to lower the volume you press the power button?
Sent from my HTC One using Tapatalk 2
Click to expand...
Click to collapse
Correct. I'm currently having the issue that my phone won't always wake using the remapped Power button, or only after 4 seconds holding it. I think it's a conflict with my ROM settings though.
While locking the phone with volume down would be nice, it prevents you from turning the volume down/vibrate/off. Which is pretty important.
Although you could alternatively hit Volume Up and then drag the slider via the touchscreen.
BTW I tried this on TrickDroid 4.2.2 and it works.
Syn Ack said:
While locking the phone with volume down would be nice, it prevents you from turning the volume down/vibrate/off. Which is pretty important.
Although you could alternatively hit Volume Up and then drag the slider via the touchscreen.
Click to expand...
Click to collapse
Actually, the adjustment only swaps the buttons, so the physical Power button acts as Volume Down
I'm still having issues with the adjustment though, has anyone tried it and got it working correctly all the time? I also edited Generic.kl and qwerty.kl, but that didn't help. Pacman ROM 2.9.
Is there any way to use his once you're in the camera . Since we don't have a dedicated camera button it would be great to set up the volume key to take pictures ?
Sent from my HTC One using xda app-developers app
Volume wake bug workaround added to OP.
Problem...
jelbo said:
Volume wake bug workaround added to OP.
Click to expand...
Click to collapse
I have multiple problems guys:
Rooted...double checked if it's rooted (htc one) - then installed Xposed...mods...guess what? it worked for a few hours then all of the sudden...Framework disabled...pushed Install again...and then one of 2 things happen:
1 - phone reboots
2 - Installed and notification for SU....but when restarting my phone the framework it's NOT installed....wtf?!?
Solutions errybody
jelbo said:
Correct. I'm currently having the issue that my phone won't always wake using the remapped Power button, or only after 4 seconds holding it. I think it's a conflict with my ROM settings though.
Click to expand...
Click to collapse
PERMANENT FIX: This problem is caused when the phone enters Deep Sleep mode, the processor stops listening to the .kl files and is pre-programmed to listen on the power button. --On mine, I was completely unable to turn the phone on, I figured out thought that I could turn it on is by holding the power button and the configured volume button at the same time, like a screenshot, hope this helps somebody.-- To permanently fix this download "Wake My Android Pro (free)" from the Play Store, this app is specifically designed to keep your phone in the "Sleep" mode and preventing it from entering the "Deep Sleep" mode. **This does not drain your battery.** Just make sure to set "Low Wake" in the settings, and set the time to 9 seconds and auto-start. Hope this helps some people, those who do not want to fiddle around with Xposed.
dare2k said:
Is there a way to remap volume keys to change song when double clicked or something?
Click to expand...
Click to collapse
This you can do via Tasker. Just create a profile: Event, Variable Set: Volume - Media. This will pick up the volume presses, from there you can restore the volume to what it was (via stored variable) and detect double-presses or gestures between the vol-up and vol-down buttons. I recommend running Javascript to detect that, to be more streamlined. Once detected, use the Media Control action to skip/restart/pause songs in OEM, or if you use Spotify or Pandora, you will have to use a shell "input keyevent 87" Use Root: Yes--87 to skip, swap it with 88 for previous, 85 to play/pause.
rollsrd said:
Is there any way to use his once you're in the camera . Since we don't have a dedicated camera button it would be great to set up the volume key to take pictures ?
Click to expand...
Click to collapse
This can be achieved with Tasker as well. Use a profile "Application," select Camera, and combine with an Event (by long-pressing profile and "Add...") Variable Set: Volume - Ringer. For the action, select Input>Button>Camera. You must be rooted.
If we combine this button swapping idea with Tasker, we can do a lot of cool things guys. An easy way to pick up an easy button gesture with Tasker is with the power button (which always works from sleep, the volume buttons can only be detected when music is playing). I use Tasker to do a certain action when the power button is double-clicked (Display On>Display Off within, say, 1 or 2 seconds).
Hope all was a help, I am new to XDA (*NOT* a noob!) and actually, this is my first post, so a thumbs up or a "thank you" or whatever you guys call it would be great. Thanks! :good:
I was looking at fake call apps for my GS4 to get me out of awkward situations.
But a lot of the good ones are missing one critical feature...being able to use it AT ANY GIVEN MOMENT!
A lot of them just have a timer (15 secs, 30 secs etc) but its a bit obvious to pull out a phone, set the schedule and BOOM 15 secs later i get a 'phone call'.
I want to be able to casually reach into my pocket, hold down the volume rockers for a few seconds and activate my pre-configured 'call'.
Then i found a couple of phones that had an excellent implementation of this: the Samsung S5511T & Samsung Intensity III.
Short story long, anyone know of an app (free or paid) that has this?
I don't know any app to do that but I think you can achieve this by using an app like Tasker to do that. Tasker is an app which allows you to perform something in a specifical context.
Configure Tasker in order to open the app which simulate a call when : screen is turned off and long press volume down button.
Hope it will help you
Thanks for the suggestion i installed tasker and have Fake Call & SMS installed
I can get the app to open using the headphone jack (best hardware option i could find) but what commands would i need in the IF statement section to make a call?
For the context I think it is possible to find a more apropriate context, ask google about tasker (Or maybe an app similar to tasker exist and has this feature)
For the fake call I think there are two options :
- you can try to create a task (in tasker) which unlock your phone and launch the app. Next, maybe tasker can emulate a press on the touchscreen. But I'm sure Tasker can emulate the press of a button, so see in your app if the press of a button can launch the fake call.
-or (I think it's an easier way) you can create a task which will : make your phone ring and vibrate and open a screenshot of a lockscreen wiwh an incoming call). Then, you only have to configure your task to stop the ringtone when you touch the screen or press a button.
1)Root your android device (most important!)
2)Get Pressy
3)Get Tasker
4)Create a Tasker profile to simulate a fake call
5)Create a Pressy button action to activate the fake call Tasker profile
6)Enjoy! :good:
I want to design an app to avoid this accidental long press on the volume button to avoid music volume's sudden increase.
In the activity, I can manage to do that by simply override the onKeyDown method.
However, in the background, there is no way to monitor the hardware key press (At least what I have found). I have tried several ways:
Use ContentObserver to monitor the volume change at background, then adjust the music volume back to original. It works, however, the system's music volume will always be increased first then adjusted back. I know several other existing app can already do this, but I don't want to do this. The small gap is very annoying if you keep pressing the volume button.
I tried to fire the main activity in the content observer (since I can override the volume key in the activity), however, it is still not simultaneous. It is even worse. Because it takes a longer time to start the activity.
So is there any other suggestion that I can overcome this problem? If I can root my phone, is it possible to monitor the key press at background?
Also, if there is no way to override the volume button at background, is there any way to set the max volume for the stream_music?
Appreciated!
I don't know, but I have an idea for you maybe:
You can use WindowManager to add Views from service, maybe these can access onKeyDown?
Kind Regards