上传备份

master
王兵 2 weeks ago
parent fb5a7c575e
commit e6c277b4ed

@ -22,7 +22,7 @@ public class 键盘操作 {
// 可以批量输入(不能含汉字)
screen.type("Hello World");
// 要输入的中文,需要通过复制实现
// 要输入的中文,自己通过复制实现(不推荐)
{
String text = "你好,世界!";
// 复制到剪贴板
@ -31,6 +31,10 @@ public class 键盘操作 {
screen.type("v", KeyModifier.CTRL);
}
// 自带的中文输入
// 使用 paste() 方法输入中文(推荐)
screen.paste("你好,这是中文输入");
// 按Enter键
screen.type(Key.ENTER);
@ -50,6 +54,21 @@ public class 键盘操作 {
// 释放Shift键
screen.keyUp(Key.SHIFT);
// 模拟 Ctrl+C复制
screen.type(Key.CTRL + "c"); // 等价于按住 Ctrl 再按 C
// 模拟 Ctrl+V粘贴
screen.type(Key.CTRL + "v");
// 模拟 Shift+A输入大写 A相当于按住 Shift 再按 A
screen.type(Key.SHIFT + "a"); // 结果为 "A"
// 模拟 Alt+F4关闭窗口
screen.type(Key.ALT + Key.F4);
// 模拟 Ctrl+Shift+Esc打开任务管理器
screen.type(Key.CTRL + Key.SHIFT + Key.ESC);
// 激活输入框后输入文本
// screen.click("input_field.png");
}

Loading…
Cancel
Save

Powered by TurnKey Linux.