[Question] input keyevent shell not working anymore

Search This thread

nuts77

Senior Member
Dec 15, 2011
445
129
[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 !
 

nuts77

Senior Member
Dec 15, 2011
445
129
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.
 

Sukarn

Senior Member
Apr 24, 2011
310
323
I had to set SELinux to permissive to get input keyevent working again.
 

Chrisu02

Senior Member
May 2, 2016
66
14
edit: sorry, wrong thread ^^"

Hello guys :)

I have a question, does this tool also support keyevent "code" only ?, or only scancodes ?

I have a controller which does only report "Code" event numbers to the Android, Scancode is always 0.

I want to use it with tasker but it does only know scancodes, so i want to try to bind the codes to scancodes.

i attaches an image of the keyevent log.

sincerely Kri
 

Attachments

  • codeevent.png
    codeevent.png
    74.5 KB · Views: 63
Last edited:

ktmom

Retired Forum Moderator
Apr 22, 2015
5,176
3,387
Deep Space Station K7
edit: sorry, wrong thread ^^"

Hello guys :)

I have a question, does this tool also support keyevent "code" only ?, or only scancodes ?

I have a controller which does only report "Code" event numbers to the Android, Scancode is always 0.

I want to use it with tasker but it does only know scancodes, so i want to try to bind the codes to scancodes.

i attaches an image of the keyevent log.

sincerely Kri
Tasker with the AutoInput plugin can intercept key codes or scan codes. See this post for an example.
 
  • Like
Reactions: Chrisu02

Chrisu02

Senior Member
May 2, 2016
66
14
Tasker with the AutoInput plugin can intercept key codes or scan codes. See this post for an example.

Thanks for that information, maybe i`ll switch if find other issue.

for now i got it to work with help from a other forums, it is working with a logcat event (profile -event - system - logcat entry)

Kri
 

Top Liked Posts

  • There are no posts matching your filters.
  • 1
    try to use the:
    Display - system lock.
    it is similar to power button.
    1
    AutoInput might also work for you.
    1
    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 !
    1
    edit: sorry, wrong thread ^^"

    Hello guys :)

    I have a question, does this tool also support keyevent "code" only ?, or only scancodes ?

    I have a controller which does only report "Code" event numbers to the Android, Scancode is always 0.

    I want to use it with tasker but it does only know scancodes, so i want to try to bind the codes to scancodes.

    i attaches an image of the keyevent log.

    sincerely Kri
    Tasker with the AutoInput plugin can intercept key codes or scan codes. See this post for an example.