save works
This commit is contained in:
@@ -22,8 +22,8 @@ public class InputEventToSendEventJsConverter extends InputEventConverter {
|
||||
private int mLastTouchY = -1;
|
||||
|
||||
public InputEventToSendEventJsConverter() {
|
||||
mCode.append("var sh = new Shell(true);\n")
|
||||
.append("sh.SetScreenMetrics(").append(getDeviceScreenWidth()).append(", ")
|
||||
mCode.append("var ies = new InputEventSender();\n")
|
||||
.append("ies.setScreenMetrics(").append(getDeviceScreenWidth()).append(", ")
|
||||
.append(getDeviceScreenHeight()).append(");\n");
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ public class InputEventToSendEventJsConverter extends InputEventConverter {
|
||||
if (mLastEventTime == 0) {
|
||||
mLastEventTime = event.time;
|
||||
} else if (event.time - mLastEventTime > 0.03) {
|
||||
mCode.append("sleep(").append((long) (1000 * (event.time - mLastEventTime))).append(");\n");
|
||||
mCode.append("sleep(").append((long) (1000L * (event.time - mLastEventTime))).append(");\n");
|
||||
mLastEventTime = event.time;
|
||||
}
|
||||
int device = parseDeviceNumber(event.device);
|
||||
@@ -51,7 +51,7 @@ public class InputEventToSendEventJsConverter extends InputEventConverter {
|
||||
}
|
||||
}
|
||||
checkLastTouch();
|
||||
mCode.append("sh.SendEvent(");
|
||||
mCode.append("ies.sendEvent(");
|
||||
if (device != mTouchDevice) {
|
||||
mCode.append(device).append(", ");
|
||||
}
|
||||
@@ -62,11 +62,11 @@ public class InputEventToSendEventJsConverter extends InputEventConverter {
|
||||
|
||||
private void checkLastTouch() {
|
||||
if (mLastTouchX >= 0) {
|
||||
mCode.append("sh.TouchX(").append(mLastTouchX).append(");\n");
|
||||
mCode.append("ies.touchX(").append(mLastTouchX).append(");\n");
|
||||
mLastTouchX = -1;
|
||||
}
|
||||
if (mLastTouchY >= 0) {
|
||||
mCode.append("sh.TouchY(").append(mLastTouchY).append(");\n");
|
||||
mCode.append("ies.touchY(").append(mLastTouchY).append(");\n");
|
||||
mLastTouchY = -1;
|
||||
}
|
||||
}
|
||||
@@ -93,7 +93,7 @@ public class InputEventToSendEventJsConverter extends InputEventConverter {
|
||||
setTouchDevice(device);
|
||||
}
|
||||
if (mLastTouchX >= 0) {
|
||||
mCode.append("sh.Touch(")
|
||||
mCode.append("ies.touch(")
|
||||
.append(mLastTouchX).append(", ")
|
||||
.append(value).append(");\n");
|
||||
mLastTouchX = -1;
|
||||
@@ -103,7 +103,7 @@ public class InputEventToSendEventJsConverter extends InputEventConverter {
|
||||
}
|
||||
|
||||
private void setTouchDevice(int i) {
|
||||
mCode.append("sh.SetTouchDevice(").append(i).append(");\n");
|
||||
mCode.append("ies.setInputDevice(").append(i).append(");\n");
|
||||
mTouchDevice = i;
|
||||
}
|
||||
|
||||
@@ -119,7 +119,7 @@ public class InputEventToSendEventJsConverter extends InputEventConverter {
|
||||
@Override
|
||||
public void stop() {
|
||||
super.stop();
|
||||
mCode.append("sh.exitAndWaitFor();");
|
||||
mCode.append("ies.exitAndWaitFor();");
|
||||
}
|
||||
|
||||
private static String hex2dec(String hex) {
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.stardust.theme;
|
||||
|
||||
import com.jecelyin.editor.v2.core.widget.JecEditText;
|
||||
import com.jecelyin.editor.v2.ui.EditorDelegate;
|
||||
import com.stardust.scriptdroid.*;
|
||||
import com.stardust.scriptdroid.R;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user