I setup my unrooted Nvidia Shield Pro 2019 so that I can control it with ABD over the network. I can open and close apps, send keyevents and sendevents.
I tried this on Chromecastcast with Google TV. I was able to put it in developer mode and enable USB Debugging.
I can connect over the network.
adb connect 192.168.0.97:5555
From my raspberry pi or linux PC I can launch apps
YoutubeTV
adb shell am start -a android.intent.action.VIEW -d -n com.google.android.youtube.tvunplugged/com.google.android.apps.youtube.tvunplugged.activity.MainActivity
Netflix
adb shell am start -a android.intent.action.VIEW -d -n *com.netflix.ninja/.MainActivity
Hulu
adb shell am start -a android.intent.action.VIEW -d -n *com.hulu.livingroomplus/.WKFactivityThe launcher
The Launcher
adb shell am start -a android.intent.action.VIEW -d -n com.google.android.apps.tv.launcherx/com.google.android.apps.tv.launcherx.home.HomeActivity
I can send keyevents
Move left
adb shell input keyevent 21
Move right
adb shell input keyevent 22
Center button
adb shell input keyevent 23
However Sendevents get permission denied
adb shell 'sendevent /dev/input/event4 0001 0106 00000001'
sendevent: /dev/input/event4: Permission denied
I didn't encounter this error on the Shield TV.
Sendevents can be faster since you can "hold" down a key for x microseconds so I would like to use them.
Is there a setting that allows for sendevents or is that going to require root?
I was trying that same thing. One thing I've been meaning to try is to plug in a keyboard and spam buttons and see what they show up as in the log. I wonder if the ones that come from the remote work differently and aren't mapped directly to the key events.
I'd forgotten that sendevents need root from /dev
I found these work. MY Samsung TV responds to the power related commands.
input keyevent 22 KEYCODE_DPAD_right
input keyevent 19 KEYCODE_DPAD_UP
input keyevent 20 KEYCODE_DPAD_DOWN
input keyevent 21 KEYCODE_DPAD_LEFT
input keyevent 23 KEYCODE_DPAD_CENTER
input keyevent 4 KEYCODE_BACK
input keyevent 26 KEYCODE_POWER toggles tv power
input keyevent 177 KEYCODE_TV_POWER toggles tv power
input keyevent 224 KEYCODE_WAKEUP turns on tv
input keyevent 223 KEYCODE_SLEEP turns off tv
Didn't get any response with keyevents listed for Mute Volume Input
Related
JB/ICS ROMs allow you to take a screenshot by long-pressing the Power and Volume Down simultaneously. But you may get unwanted screen artifacts or other strange behavior if you don’t press them exactly at the same time.
But my new Atrix4g Screen Shot (A4G SS) tool overcomes by invoking virtual key presses for Power and Volume Down using the “sendevent” command. Basically it’s remote control.
And it has a self-timer with adjustable delay. So among other things, you can run it with your built-in camera to take family/group portraits --- though the camera buttons will show .
Flashable zip (0.2 MB): http://www.mediafire.com/?18h1bzqcca3g15u
A4GG SS is tested working on CM10 SuperLite. I was going to try it on other JB/ICS ROMs but I ran out of time.
There are many ways to launch A4G SS. Examples:
Root Explorer (very simple once you set home directory to /system/bin)
Script Manager (not as simple at first, but easily configurable and settings are retained)
Terminal Emulator (not as simple but geeky)
ADB (remote operation)
Instructions on how to configure A4GG with Script Manager are given further below.
Key legends reside in the /system/usr/keylayout directory. Those of interest here are documented in my A4GG SS launch code:
Code:
#!/system/bin/sh
echo
echo "Atrix4g Screen Shot With Self-Timer!"
echo "Usage: sh a4g-screencap.sh [timer delay (sec)]"
echo "Default delay: 10 sec"
echo
echo "Initial Release: 11 May 2013"
echo "sendust7 @ xda developers"
#Atrix4g key map legends (decimal):
#/dev/input/event0
#key 107 POWER WAKE
#key 26 POWER WAKE
#key 226 HEADSETHOOK WAKE
#/dev/input/event1
#key 102 HOME WAKE
#key 139 MENU WAKE_DROPPED
#key 158 BACK WAKE_DROPPED
#key 211 FOCUS
#key 212 CAMERA
#key 115 VOLUME_UP WAKE
#key 114 VOLUME_DOWN WAKE
#key 217 SEARCH WAKE_DROPPED
echo
if grep -qs $EXTERNAL_STORAGE /proc/mounts; then
echo "$EXTERNAL_STORAGE mounted"
elif grep -qs $SECONDARY_STORAGE /proc/mounts; then
echo "$SECONDARY_STORAGE mounted"
else
echo "Phone storage not mounted. Exiting..."
exit 1
fi
echo
if [ $# -eq 0 ]; then
echo "Taking screen shot in 10 seconds..."
sleep 10
else
echo "Taking screen shot in $1 seconds..."
sleep $1
fi
#Long press POWER and VOL Down simultaneously
/system/bin/sendevent /dev/input/event0 1 107 1
/system/bin/sendevent /dev/input/event1 1 114 1
sleep 2
#Release POWER and VOL Down simultaneously
/system/bin/sendevent /dev/input/event0 1 107 0
/system/bin/sendevent /dev/input/event1 1 114 0
echo
echo "Done! Can exit now..."
exit 0
Instructions
Simply flash zip, reboot and optionally install/configure Script Manager (SManager): Go to Settings > Advanced > Configuration > Home directory. Navigate to /system/bin and “Select this directory” at bottom.
SManager: https://play.google.com/store/apps/details?id=os.tools.scriptmanager&hl=en
Make sure USB storage is turned off to save your screenshot. A4G SS includes logic to exit unless internal storage, external storage or both are mounted.
Then re-launch SManager, navigate to “/system/bin/atrix4g-ss-v1.0.sh” and tap:
Code:
“Su” (run as root --- setting is retained for later)
“Run”
“Home” (navigate to screen of interest)
Wait for the timeout. A message: “Saving screenshot” will appear at top. To view your screenshot, simply drag the pull down menu, tap the “Screenshot captured” bar and complete the action.
After screenshot, A4G SS exits gracefully. To re-launch from SManager, tap HOME > “Run Again”. To exit, tap the Back button on your Atrix.
If you want to change the default 10-second timeout, simply enter a different (positive) number in SManager’s argument box and re-launch. This setting is also retained.
Things go pretty fast after initial setup.
I understand many screenshot apps are available, and Screenshot UX is my favorite. But the trial version expires after 14 rounds --- not because I don’t like to pay for a good app. I just don’t like Google having my credit card number.
My A4G SS tool is free, and the maximum allowable number of screenshots is limited only by available storage
You can also run A4G SS from ADB-enabled remote device:
adb shell /system/bin/atrix4g-ss-v1.0.sh [N]
where N = delay time (sec).
This is how I took demo shots of A4G SS in action I just set N=0 for an instant shot.
And you can spin your Atrix beauty into an efficient "still-moving" security cam using a delayed while loop and camera ON/shoot/OFF commands at fixed intervals. Something like this…
Code:
#Wait two hours
sleep 7200
#Start monitoring
while :
do
/system/bin/sendevent /dev/input/event1 1 212 1
sleep 2
#Long press POWER and VOL Down simultaneously
/system/bin/sendevent /dev/input/event0 1 107 1
/system/bin/sendevent /dev/input/event1 1 114 1
sleep 2
#Release POWER and VOL Down simultaneously
/system/bin/sendevent /dev/input/event0 1 107 0
/system/bin/sendevent /dev/input/event1 1 114 0
sleep 2
/system/bin/sendevent /dev/input/event1 1 158 0
#Wait 5 minutes until next picture
sleep 300
done
The companion “getevent” command is also very useful. For example it helps you learn the various key legends or to capture a time stamped history of sendevent commands.
Code:
Usage: getevent [-t] [-n] [-s switchmask] [-S] [-v [mask]] [-d] [-p] [-i] [-l] [-q] [-c count] [-r] [device]
-t: show time stamps
-n: don't print newlines
-s: print switch states for given bits
-S: print all switch states
-v: verbosity mask (errs=1, dev=2, name=4, info=8, vers=16, pos. events=32, props=64)
-d: show HID descriptor, if available
-p: show possible events (errs, dev, name, pos. events)
-i: show all device info and possible events
-l: label event types and names in plain text
-q: quiet (clear verbosity mask)
-c: print given number of events then exit
-r: print rate events are received
1|[email protected]:/ #
Screenshots
Blessings... Enjoy!
Disclaimer: Standard disclaimers apply.
References:
http://android.stackexchange.com/questions/26261/documentation-for-adb-shell-getevent-sendevent
http://source.android.com/tech/input/getevent.html
http://fangmobile.com/2012/11/06/an...lick-on-screen-for-ics-and-may-be-jelly-bean/
https://groups.google.com/forum/?fromgroups=#!topic/android-beginners/il2PqSKRFNI
1st
Thanks for this useful app
I will try it soon
Hi all,
I would like to add a button on my home screen in order to clear all recent apps without having to long press on the home button and so on.
Is there any command or variable on tasker to make this possible?
Thx for helping
Envoyé avec ma brique Galaxy Note.
Advanced Task Killer (in playstore).
And then place the widget on home screen.
One-click-kill.
I just want to clear recent apps not kill all tasks! I already have greenify.
Envoyé avec ma brique Galaxy Note.
bump. i need that too...
A little help from someone?
Envoyé avec ma brique Galaxy Note.
pakman023 said:
I would like to add a button on my home screen in order to clear all recent apps without having to long press on the home button and so on.
Is there any command or variable on tasker to make this possible?
Click to expand...
Click to collapse
I would like to have something like that as well to call it from Llama, so it should be either a simple application that clears all recent apps on start without asking or an intent that can be called by LLama.
Thx!
Envoyé avec ma brique Galaxy Note.
newest lbe ha a toggle for that, 360 launcher as well. when using both ram is quickly cleared.
Given androids ram optimalization its also quickly filled again lol.
Sent from my GT-N7000 using Tapatalk 2
Looking for a similar solution I ended up just using sendevent commands to simulate long pressing the home button & input tap
sendevent /dev/input/event16 1 172 1
sendevent /dev/input/event16 0 0 0
sleep 1
sendevent /dev/input/event16 1 172 0
sendevent /dev/input/event16 0 0 0
input tap 900 1850
Works great on my S4 but you may need to enable pointer in developer options & modify the tap x y. Similarly I also wanted to clear my ram & app cache & ended up putting it all together in 2 tasks that perform either with shake events(etcha sketch?)
okninja said:
(etcha sketch?)
Click to expand...
Click to collapse
oooh yeah!!!! nice touch
Install xposed framework and then Gravity Box will give you the option on a nexus 5. Couldn't find the option on Tasker either.
Is this configured under "Shell Script"?
okninja said:
Looking for a similar solution I ended up just using sendevent commands to simulate long pressing the home button & input tap
sendevent /dev/input/event16 1 172 1
sendevent /dev/input/event16 0 0 0
sleep 1
sendevent /dev/input/event16 1 172 0
sendevent /dev/input/event16 0 0 0
input tap 900 1850
Works great on my S4 but you may need to enable pointer in developer options & modify the tap x y. Similarly I also wanted to clear my ram & app cache & ended up putting it all together in 2 tasks that perform either with shake events(etcha sketch?)
Click to expand...
Click to collapse
okninja said:
Looking for a similar solution I ended up just using sendevent commands to simulate long pressing the home button & input tap
sendevent /dev/input/event16 1 172 1
sendevent /dev/input/event16 0 0 0
sleep 1
sendevent /dev/input/event16 1 172 0
sendevent /dev/input/event16 0 0 0
input tap 900 1850
Works great on my S4 but you may need to enable pointer in developer options & modify the tap x y. Similarly I also wanted to clear my ram & app cache & ended up putting it all together in 2 tasks that perform either with shake events(etcha sketch?)
Click to expand...
Click to collapse
Could you explain how you did this?
I've spent the last hour trying to get it done on my AT&T Galaxy S4 running GPE 4.4 ROM and can't get it to work.
Thanks!
Extra help
Hi, I'm new to forums and Tasker. Could you please explain step-by-step how you created this please? Your method seems to be the only one on the internet.... and its beyond my knowledge of Tasker.
Thanks
okninja said:
Looking for a similar solution I ended up just using sendevent commands to simulate long pressing the home button & input tap
sendevent /dev/input/event16 1 172 1
sendevent /dev/input/event16 0 0 0
sleep 1
sendevent /dev/input/event16 1 172 0
sendevent /dev/input/event16 0 0 0
input tap 900 1850
Works great on my S4 but you may need to enable pointer in developer options & modify the tap x y. Similarly I also wanted to clear my ram & app cache & ended up putting it all together in 2 tasks that perform either with shake events(etcha sketch?)
Click to expand...
Click to collapse
Storm85 said:
Hi, I'm new to forums and Tasker. Could you please explain step-by-step how you created this please? Your method seems to be the only one on the internet.... and its beyond my knowledge of Tasker.
Thanks
Click to expand...
Click to collapse
Hi guys landed here because I searched for this problem ....
I came up with a solution myself since the method described here is different for every device I think this should work for most
Open tasker -->new task--> script ---> run shell --> and paste this in the command line :
input keyevent APP_SWITCH
input tap 2150 1540
these numbers "2150 1540 " are for my note 10.1 2014 edition ... these are coordinates which set the location for the simulated touch tap ...
you can get your x y coordinates by enabling show cursor position in develepor options
this command does open the recent apps menu
and presses the close all all apps button
greetings
Medy89
Medy89 said:
Hi guys landed here because I searched for this problem ....
I came up with a solution myself since the method described here is different for every device I think this should work for most
Open tasker -->new task--> script ---> run shell --> and paste this in the command line :
input keyevent APP_SWITCH
input tap 2150 1540
these numbers "2150 1540 " are for my note 10.1 2014 edition ... these are coordinates which set the location for the simulated touch tap ...
you can get your x y coordinates by enabling show cursor position in develepor options
this command does open the recent apps menu
and presses the close all all apps button
greetings
Medy89
Click to expand...
Click to collapse
Thanks for this. However it isn’t working. I have a Galaxy Note 3 and assuming it’s the Xv: and Yv co ordinates I have 0.073 and 0.263.
But when I enter
input keyevent APP_SWITCH
input tap 0.073 0.263
It doesn’t work and the task seems to take a while to stop running.
What am I doing wrong?
If I do
new task--> script ---> run shell --> input keyevent APP_SWITCH
and click run should it open up the recent apps list? Because it doesn’t.
Thanks,
Storm85 said:
Thanks for this. However it isn’t working. I have a Galaxy Note 3 and assuming it’s the Xv: and Yv co ordinates I have 0.073 and 0.263.
But when I enter
input keyevent APP_SWITCH
input tap 0.073 0.263
It doesn’t work and the task seems to take a while to stop running.
What am I doing wrong?
If I do
new task--> script ---> run shell --> input keyevent APP_SWITCH
and click run should it open up the recent apps list? Because it doesn’t.
Thanks,
Click to expand...
Click to collapse
From what I understand, note 10.1 2014 still running on Android 4.3 but Note 3 already in 4.4.2, I guess Kitkat might have change this.
Storm85 said:
Thanks for this. However it isn’t working. I have a Galaxy Note 3 and assuming it’s the Xv: and Yv co ordinates I have 0.073 and 0.263.
But when I enter
input keyevent APP_SWITCH
input tap 0.073 0.263
It doesn’t work and the task seems to take a while to stop running.
What am I doing wrong?
If I do
new task--> script ---> run shell --> input keyevent APP_SWITCH
and click run should it open up the recent apps list? Because it doesn’t.
Thanks,
Click to expand...
Click to collapse
just take the X and Y not Xv Yv
there schouldnt be points and commas
ill check if input keyevent APP_SWITCH works on kitkat
meanwhile try
input keyevent KEYCODE_APP_SWITCH
look again
btw im doing a tasker series on youtube ill probably do a vid about this some time
check out my channel^^
First vid :
https://www.youtube.com/watch?v=KYADIOL_LPE&feature=youtu.be
Medy89 said:
just take the X and Y not Xv Yv
there schouldnt be points and commas
ill check if input keyevent APP_SWITCH works on kitkat
meanwhile try
input keyevent KEYCODE_APP_SWITCH
look again
btw im doing a tasker series on youtube ill probably do a vid about this some time
check out my channel^^
First vid :
https://www.youtube.com/watch?v=KYADIOL_LPE&feature=youtu.be
Click to expand...
Click to collapse
i have android kitkat..
i couldnt call input keyevent KEYCODE_APP_SWITCH
nothing happen..somebody help
bdkbaik said:
i have android kitkat..
i couldnt call input keyevent KEYCODE_APP_SWITCH
nothing happen..somebody help
Click to expand...
Click to collapse
it works on kitkat ... just tried it ... u need ROOT
AUTOMATE MY LIFE
A LIST OF AUTOMATION SCRIPTS AND PROGRAMS THAT WILL AUTOMATE YOUR EVERYDAY LIFE.
MOST BUT NOT ALL OF THESE TUTORIALS REQUIRE TASKER AND A PLUGIN OF SOME SORT.
WINDOWS TUTORIALS CAN BE FOUND IN THE FIRST POST.
LINUX TUTORIALS CAN BE FOUND IN THE SECOND POST.
GENERAL TUTORIALS CAN BE FOUND IN BOTH POSTS.
THERE WILL BE SOME TASKS THAT ARE ONLY LISTED ON WINDOWS AND SOME TASKS THAT ARE ONLY ONLY LISTED ON LINUX, THIS DOES NOT MEAN IT IS NOT POSSIBLE TO PERFORM THEM ON OTHER PLATFORMS IT JUST MEANS I AM UNSURE OF HOW TO GET THEM TO WORK.
WINDOWS
Automatically Turn On Your Computer on a Schedule
Over View
This task is reasonable easy to set up, It will allow you to turn on your home or work pc on a schedule. In this case we are turning on our computer as soon as we unplug our device from the charger.
Requirements
Tasker
Wol Wake on Lan Wan
Setup
Before we get into creating our task we first need to set up the Wol Wake on Lan Wan application
Enable Wake on Lan
On the computer go to Control Panel>Network and Internet>Network and Sharing Center
Click on Change Adapter settings
Right Click on Ethernet and go to properties
Click Configure and then click the Advanced tab
Find Wake on Magic Packet and Change the Value to Enabled
Find Your Mac Address
Open Command Prompt
type "ipconfig /all"
under Ethernet adapter find physical address(00-11-22-33-44-55)
Remember It or write it down
Setup Wol Wake on Lan Wan
Open Wol Wake on Lan Wan
Press Add New
Under Name Call It Anything
Under Mac Enter your mac address as in ipconfig
Under SecureOn Leave As Is
Under IP or Domain Enter your Default Gateway also found in ipconfig
Under Port Leave as is
Check Send as Broadcast
The Rest is fine as default
Press Save
Create The Task
Open Tasker
Press the TASKS Tab
Press The +
Give The Task A Name Like Switch on Home PC
Press The +
Press Plugin
Press WoL Wake On Lan
Press the configuration pencil
Select the name you chose when setting up Wol Wake on Lan
Press the back button twice to save changes to configuration and task
Create The Profile
Press the profiles tab
Press the + Button to add a new profile
Select State
Select Power
Select Power
Select Source Any
press back to save
select the task we created
long press on the task and press move to exit
LINUX
Notify Me When Detecting Movement In My House
Overview
We will use simplecv as a security camera to detect motion in our house. it will then send a notification to our phone alerting us that someone is inside.
Requirements
SimpleCV
WebCam or IP Camera
Tasker
Autoremote
Setup
Install SimpleCV
Thanks To Tinkernut for this tutorial
Open Terminal and Type
Code:
sudo apt-get update
sudo apt-get install ipython python-opencv python-scipy python-numpy python-setuptools
sudo pip install https://github.com/sightmachine/SimpleCV/zipball/master
sudo pip install pyparsing svgwrite
simplecv
Setting Up The Script
Make a new python file called camera.py
Code:
sudo nano camera.py
and paste this code
Code:
'''THIS IS A MOTION DETECTING PROGRAM FOR THE RASPBERRY PI
It is part of a tutorial series that you can find here:
https://www.youtube.com/playlist?list=PLlg8lN4r9qWiDzF13lJY-lGtiTFHHGcpx
Running this program requires installing SimpleCV as well as
a few other prerequisits on your pi. You can find detailed
instructions for how to do that here:
http://tinkernut.com/YtQH9
The script was slightly modified by slipsystem to send a autoremote command
'''
#!/usr/bin/python
#import the SimpleCV, shutil and urllib libraries
from SimpleCV import *
import shutil
import urllib
#set autoremote variables
#key taken from http://goo.gl/xxxxx
autoremotekey = ""
#message to send autoremote
autoremotemessage = "Motion Detected"
#initialize the camera
cam = Camera()
#set the max display size
display = Display((800,600))
#create a threshold variable to change motion sensitivity
threshold = 0.5
#get the date for saving images
datestr = time.strftime("%Y%m%d")
#set a streaming variable to stream webcam online
streaming = JpegStreamer("0.0.0.0:1212")
#create destination directorie for the pictures
dst = "pic/%s" % (datestr) #destination directory for images
#if the picture directories don't exist, create them
if not os.path.exists(dst):
os.makedirs(dst)
#create a loop that constantly grabs new images from the webcam
while True:
#set a time variable that updates with the loop
current_time = time.time()
#grab an image still from the camera and convert it to grayscale
img01 = cam.getImage().toGray()
#wait half a second
time.sleep(0.05)
#grab an unedited still to use as our original image
original = cam.getImage()
#set webcam image
original.save(streaming)
#grab another image still from the camera and conver it to grayscale
img02 = cam.getImage().toGray()
#subract the images from each other, binarize and inver the colors
diff = (img01 - img02).binarize(50).invert()
#dump all the values into a Numpy matrix and extract the mean avg
matrix = diff.getNumpy()
mean = matrix.mean()
#find and highlight the objects within the image
blobs = diff.findBlobs()
#if the mean is greater than our threshold variable, then look for objects
if mean >= threshold:
#check to see if any objects were detected
if blobs:
#find the central point of each object
#and draw a red circle around it
for b in blobs:
try:
loc = (b.x,b.y) #locates center of object
original.drawCircle(loc,b.radius(),Color.RED,2)
except:
e = sys.exc_info()[0]
#use the current date to create a unique file name
timestr = time.strftime("%H%M%S")
#initialize the counter variable
i = 1
#check to see if the filename already exists
while os.path.exists("pic/motion%s-%s.png" % (timestr, i)):
#if it does, add one to the filename and try again
i += 1
#once a unique filename has been found, save the image
original.save(dst + "/motion%s-%s.png" % (timestr, i))
#print results to terminal
print("Motion Detected")
f = urllib.urlopen("https://autoremotejoaomgcd.appspot.com/sendmessage?key=" + autoremotekey + "&message=" + autoremotemessage)
print("Message Send " + f.read())
open autoremote and follow your link (goo.gl/xxxx)
once you have opened the link you will notice the url say something like key=xxxxx
paste the key inside autoremotekey = ""
save the script by typing ctrl+x
run the python script by typing
Code:
python camera.py
now your camera server should be running ,if you move in front of the camera you should see a output of motion detected
Create The Task
The Task can be whatever you want to run when the camera detects motion in my case I have it play your dongeon is under attack then open the camera viewer. but for the purpose of this tutorial we are going to make it just open the camera.
Open Tasker
Press the TASKS Tab
Press The +
Give The Task A Name Like Camera
Press The +
Click Net
Click Browse URL
Enter the Ip address of your computer(ifconfig) followed by :1212 (192.168.1.12:1212)
Press the back button to save
Press the +
Press Task
Press Wait
adjust the slider to one minute so we don’t get bombarded with messages
press back twice to save configuration and task
Create The Profile
Press the profiles tab
Press the + Button to add a new profile
Select State
Select Plugin
Select Autoremote
Press the Configuration pencil
Check Event Behavior
Message Filter type Motion Detected
press back twice to save
click the newly created task
I'm installing a nexus 7 (2013) into the dash of my car. I'd like to have a widget on my home screen to pull up the original power menu. I've been told there is a way to do it with tasker and running a shell script. If anyone could help me it would be greatly appreciated.
You can use AutoInput plugin, it can do what you ask for. Just create an action, select the AutoInput plugin, and: Plugin > AutoInput > Global Action > Power Dialog.
Another way by you can do that and also will be more customizable (you could add or remove power actions by default) is taking first a screenshot of the powermenu pop-up, then edit it on any image editor like: Photoshop, GIMP. . . And at last take the edited image into the phone again, and use this modified screenshot as your powermenu pop-up with a scene.
This is what I did on one of my anti-theft tasks, and I'm happy with my custom power menu dialog
sendevent /dev/input/event5 1 116 1
sendevent /dev/input/event5 0 0 0
usleep 500000
sendevent /dev/input/event5 1 116 0
sendevent /dev/input/event5 0 0 0
to be run in a shell-task, root
'ks123', the code you provided us is generic. Will be necessary to adjust it to our device.
You're right
it should be .../event2 on the Nexus ...
More info:
http://stackoverflow.com/questions/26204766/simulating-combination-of-key-presses-from-adb-terminal
is there any way to figure out how to trigger one-handed mode via adb so I can remap it to other buttons?
bump on this...
HTML:
am broadcast -a miui.action.handymode.changemode --ei mode 1
1 is left
2 is right
BTW: Root request