-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from nfh994/master
- Loading branch information
Showing
11 changed files
with
331 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,6 @@ | |
|
||
# Ignore Gradle build output directory | ||
build | ||
release | ||
|
||
local.properties |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
使用参考 [minitouch](https://github.com/DeviceFarmer/minitouch) | ||
|
||
说明 | ||
|
||
c 提交指令 | ||
|
||
r 重置触点指令 | ||
|
||
d id x y pressure 按下触点 | ||
|
||
m id x y pressure 移动触点 | ||
|
||
u id 抬起触点 | ||
|
||
w ms 指令执行等待 | ||
|
||
k key d 按键按下 | ||
|
||
k key u 按键抬起 | ||
|
||
k key o 单次按键,按下抬起 | ||
|
||
t text 输入文本 | ||
|
||
示例: | ||
|
||
1:在10 10点击 | ||
|
||
d 0 10 10 1 | ||
|
||
u 0 | ||
|
||
c | ||
|
||
2:滑动 | ||
|
||
d 0 10 10 1 | ||
|
||
w 100 | ||
|
||
m 0 20 20 1 | ||
|
||
w 100 | ||
|
||
m 0 30 30 1 | ||
|
||
w 100 | ||
|
||
u 0 | ||
|
||
c | ||
|
||
3: 点亮屏幕 | ||
|
||
k 224 o | ||
|
||
c | ||
|
||
4:删除文本框内容 | ||
|
||
k 123 o | ||
|
||
k 67 d | ||
|
||
w 1000 | ||
|
||
k 67 u | ||
|
||
c | ||
|
||
5:输入文本 | ||
|
||
t 内容 | ||
|
||
c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package com.shxyke.MaaTouch; | ||
|
||
public class KeyThread extends Thread { | ||
private boolean isRunning = true; | ||
private final Controller controller; | ||
private int keyCode; | ||
private int repeat = 0; | ||
public KeyThread(Controller controller,int keyCode) { | ||
this.controller = controller; | ||
this.keyCode = keyCode; | ||
} | ||
@Override | ||
public void run() { | ||
do { | ||
controller.injectKeyDown(keyCode,repeat++,0); | ||
try { | ||
Thread.sleep(1000 / 20); | ||
} catch (InterruptedException e) { | ||
e.printStackTrace(); | ||
} | ||
}while(this.isRunning); | ||
controller.injectKeyUp(keyCode,0,0); | ||
} | ||
public void stopThread() { | ||
this.isRunning = false; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.