mirror of
https://github.com/Genymobile/scrcpy.git
synced 2025-08-03 14:49:29 +00:00
Formatting cleanup
Change function order so its consistent throughout the program -> action,keycode,metastate,repeat
This commit is contained in:
parent
d297747469
commit
11104f91ed
4 changed files with 6 additions and 7 deletions
|
@ -74,7 +74,6 @@ public class Controller {
|
||||||
switch (msg.getType()) {
|
switch (msg.getType()) {
|
||||||
case ControlMessage.TYPE_INJECT_KEYCODE:
|
case ControlMessage.TYPE_INJECT_KEYCODE:
|
||||||
if (device.supportsInputEvents()) {
|
if (device.supportsInputEvents()) {
|
||||||
//Ln.w("Unknown event type: " + msg.getRepeat());
|
|
||||||
injectKeycode(msg.getAction(), msg.getKeycode(), msg.getMetaState(), msg.getRepeat());
|
injectKeycode(msg.getAction(), msg.getKeycode(), msg.getMetaState(), msg.getRepeat());
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -132,7 +131,7 @@ public class Controller {
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean injectKeycode(int action, int keycode, int metaState, int repeat) {
|
private boolean injectKeycode(int action, int keycode, int metaState, int repeat) {
|
||||||
return device.injectKeyEvent(action, keycode, repeat, metaState);
|
return device.injectKeyEvent(action, keycode, metaState, repeat);
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean injectChar(char c) {
|
private boolean injectChar(char c) {
|
||||||
|
|
|
@ -167,7 +167,7 @@ public final class Device {
|
||||||
return injectEvent(event, InputManager.INJECT_INPUT_EVENT_MODE_ASYNC);
|
return injectEvent(event, InputManager.INJECT_INPUT_EVENT_MODE_ASYNC);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean injectKeyEvent(int action, int keyCode, int repeat, int metaState) {
|
public boolean injectKeyEvent(int action, int keyCode, int metaState, int repeat) {
|
||||||
long now = SystemClock.uptimeMillis();
|
long now = SystemClock.uptimeMillis();
|
||||||
KeyEvent event = new KeyEvent(now, now, action, keyCode, repeat, metaState, KeyCharacterMap.VIRTUAL_KEYBOARD, 0, 0,
|
KeyEvent event = new KeyEvent(now, now, action, keyCode, repeat, metaState, KeyCharacterMap.VIRTUAL_KEYBOARD, 0, 0,
|
||||||
InputDevice.SOURCE_KEYBOARD);
|
InputDevice.SOURCE_KEYBOARD);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue