mirror of
https://github.com/Genymobile/scrcpy.git
synced 2025-04-20 19:45:00 +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
|
@ -36,7 +36,7 @@ public final class ControlMessage {
|
|||
private ControlMessage() {
|
||||
}
|
||||
|
||||
public static ControlMessage createInjectKeycode(int action, int keycode, int metaState,int repeat) {
|
||||
public static ControlMessage createInjectKeycode(int action, int keycode, int metaState, int repeat) {
|
||||
ControlMessage msg = new ControlMessage();
|
||||
msg.type = TYPE_INJECT_KEYCODE;
|
||||
msg.action = action;
|
||||
|
|
|
@ -100,7 +100,7 @@ public class ControlMessageReader {
|
|||
int keycode = buffer.getInt();
|
||||
int metaState = buffer.getInt();
|
||||
int repeat = buffer.getInt();
|
||||
return ControlMessage.createInjectKeycode(action, keycode, metaState,repeat);
|
||||
return ControlMessage.createInjectKeycode(action, keycode, metaState, repeat);
|
||||
}
|
||||
|
||||
private String parseString() {
|
||||
|
|
|
@ -74,8 +74,7 @@ public class Controller {
|
|||
switch (msg.getType()) {
|
||||
case ControlMessage.TYPE_INJECT_KEYCODE:
|
||||
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;
|
||||
case ControlMessage.TYPE_INJECT_TEXT:
|
||||
|
@ -131,8 +130,8 @@ public class Controller {
|
|||
}
|
||||
}
|
||||
|
||||
private boolean injectKeycode(int action, int keycode, int metaState,int repeat) {
|
||||
return device.injectKeyEvent(action, keycode, repeat, metaState);
|
||||
private boolean injectKeycode(int action, int keycode, int metaState, int repeat) {
|
||||
return device.injectKeyEvent(action, keycode, metaState, repeat);
|
||||
}
|
||||
|
||||
private boolean injectChar(char c) {
|
||||
|
|
|
@ -167,7 +167,7 @@ public final class Device {
|
|||
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();
|
||||
KeyEvent event = new KeyEvent(now, now, action, keyCode, repeat, metaState, KeyCharacterMap.VIRTUAL_KEYBOARD, 0, 0,
|
||||
InputDevice.SOURCE_KEYBOARD);
|
||||
|
|
Loading…
Add table
Reference in a new issue