我只想知道如何在本机脚本中访问音量增大和减小键。
答案 0 :(得分:1)
我不知道您要尝试的电源按钮,但要处理按键事件,您可以尝试覆盖KeyCode
简而言之,您处理事件并处理Action
和@Override
public boolean dispatchKeyEvent(KeyEvent event) {
// Which direction did the key move (up/down)
int action = event.getAction();
// What keywas pressed
int keyCode = event.getKeyCode();
switch (keyCode) {
case KeyEvent.KEYCODE_VOLUME_UP:
// Check your event code (KeyEvent.ACTION_DOWN, KeyEvent.ACTION_UP etc)
return true;
case KeyEvent.KEYCODE_VOLUME_DOWN:
// Check your event code (KeyEvent.ACTION_DOWN, KeyEvent.ACTION_UP etc)
return true;
default:
// Let the system do what it wanted to do
return super.dispatchKeyEvent(event);
}
}
- 类似这样的事情
KeyEvent
以下是despatchKeyEvent
个full list选项。希望这会让你前进。有关$ openssl sha256 -sign privatekey.pem myfile.txt > right.result
here