Android: 设置模拟按键快捷方式

2019-07-14 00:56发布

为了方便调试,设置模拟按键快捷方式:

alias w='input keyevent DPAD_UP'
alias s='input keyevent DPAD_DOWN'
alias a='input keyevent DPAD_LEFT'
alias d='input keyevent DPAD_RIGHT'
alias e='input keyevent ENTER'
alias q='input keyevent BACK'
alias r='input keyevent HOME'
alias t='input text '

为了能单手操作,也可以利用小键盘的“Enter”键,设置成下面的方式:
alias 8='input keyevent DPAD_UP'
alias 2='input keyevent DPAD_DOWN'
alias 4='input keyevent DPAD_LEFT'
alias 6='input keyevent DPAD_RIGHT'
alias 5='input keyevent ENTER'
alias 1='input keyevent BACK'
alias 7='input keyevent HOME'
alias 0='input text '