FORUMS
Remove All Ads from XDA

[Question] input keyevent shell not working anymore

444 posts
Thanks Meter: 130
 
By nuts77, Senior Member on 8th March 2016, 03:52 PM
Post Reply Email Thread
[Question] input keyevent shell not working anymore

Hello everyone !

I have been using a lot of profiles with a task to turn screen off (simulate a power button press) without locking it.
Was quite helpful in some cases. So I was using the shell command "input keyevent 23" (23 if I remember well, whatever).
But since lollipop, it seems input keyevent command is not working anymore...

Anyone knows why ? Is there any workaround ?
Thanks !
8th March 2016, 03:57 PM |#2  
Senior Member
Thanks Meter: 40
 
More
Work. ROOT needed.
23 - dpad center
26 - power

Lolipop. NOTE3.
8th March 2016, 04:06 PM |#3  
nuts77's Avatar
OP Senior Member
Thanks Meter: 130
 
More
Thanks for the heads up
Yeah 26, I remember now...

I'm rooted. Just tried and I get the error message in tasker :

16.04.09/Shell runBackground input keyevent 26 root: true timeout: -1
16.04.09/Shell start process-thread ID 196
16.04.09/E add wait type Shell2 time 2147483647
16.04.09/E add wait type Shell2 done

I'm using a HTC One M9. Maybe this is a HTC Sense limitation... No idea why it isn't working. Root checked.
8th March 2016, 04:09 PM |#4  
Senior Member
Thanks Meter: 40
 
More
KingoRoot? Kingroot? [Never remember]
8th March 2016, 04:54 PM |#5  
nuts77's Avatar
OP Senior Member
Thanks Meter: 130
 
More
Quote:
Originally Posted by frrancuz.

KingoRoot? Kingroot? [Never remember]

Nope, rooted the good old' way! Unlocking BL, flashing custom ROM with superSU...
8th March 2016, 04:58 PM |#6  
Senior Member
Thanks Meter: 40
 
More
try to use the:
Display - system lock.
it is similar to power button.
The Following User Says Thank You to frrancuz. For This Useful Post: [ View ] Gift frrancuz. Ad-Free
8th March 2016, 06:19 PM |#8  
Senior Member
Thanks Meter: 321
 
More
I had to set SELinux to permissive to get input keyevent working again.
9th March 2016, 10:42 AM |#9  
nuts77's Avatar
OP Senior Member
Thanks Meter: 130
 
More
Quote:
Originally Posted by Sukarn

I had to set SELinux to permissive to get input keyevent working again.

Thanks ! That was the thing It's working again !

For whoever interested, now have to change the code to :

setenforce 0; input keyevent 26; setenforce 1

Thanks !
The Following User Says Thank You to nuts77 For This Useful Post: [ View ] Gift nuts77 Ad-Free
9th March 2016, 10:43 AM |#10  
nuts77's Avatar
OP Senior Member
Thanks Meter: 130
 
More
Quote:
Originally Posted by frrancuz.

try to use the:
Display - system lock.
it is similar to power button.

Thanks ! It works but I want the system to remain unlocked if it is
11th April 2017, 09:12 AM |#11  
Member
Flag Copenhagen
Thanks Meter: 10
 
More
Quote:
Originally Posted by MishaalRahman

AutoInput might also work for you.

I have been trying to do that, but with no luck. Can you give a hint as to how to set it up correctly?
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes