导航:首页 > 编程语言 > java虚拟键盘

java虚拟键盘

发布时间:2023-06-28 11:52:08

❶ 如何在java里添加虚拟键盘

设置-程序管理-已安装的程序-点你想要的程序套件设备*屏幕键盘!

❷ java 调用系统虚拟键盘

不行,这个做不到,智能手机才可以做到的。不过java程序的特点就在这里,它用虚拟机技术,技术java应用程序出错也不会对手机底层系统软件造成影响。

❸ java图形界面里怎么做一个虚拟键盘

很麻烦,你可以用用加载背景图片的方式,也可以用按钮的方式,然后绑定每一个按钮的事件,反正是各种麻烦

❹ 如何在手机java游戏中插入虚拟键盘

给你一个例子,用AWT包可以实现,但是,不知你是要标准26键盘,还是手机数字键盘:
import java.awt.AWTException;
import java.awt.Robot;
import java.awt.event.KeyEvent;
import java.io.IOException;

/**
*
*/

/**
* @ samuel
*
*/
public class RobotExp {
public static void pressKey(Robot robot, int keyvalue) {
robot.keyPress(keyvalue);
robot.keyRelease(keyvalue);
}

public static void pressKeyWithShift(Robot robot, int keyvalue) {
robot.keyPress(KeyEvent.VK_SHIFT);
robot.keyPress(keyvalue);
robot.keyRelease(keyvalue);
robot.keyRelease(KeyEvent.VK_SHIFT);
}

public static void closeApplication(Robot robot) {
// pressKey(robot, KeyEvent.VK_ALT);
// pressKey(robot, KeyEvent.VK_F4);
robot.keyPress(KeyEvent.VK_ALT);
robot.keyPress(KeyEvent.VK_F4);
robot.keyRelease(KeyEvent.VK_ALT);
robot.keyRelease(KeyEvent.VK_F4);
// for linux.
// robot.keyPress(KeyEvent.VK_ALT);
// robot.keyPress(KeyEvent.VK_W);
// robot.keyRelease(KeyEvent.VK_ALT);
// robot.keyRelease(KeyEvent.VK_W);
robot.keyPress(KeyEvent.VK_N);
robot.keyRelease(KeyEvent.VK_N);
}

public static void main(String[] args) throws IOException {
try {
Robot robot = new Robot();
Runtime.getRuntime().exec("notepad");
// For linux.
// Runtime.getRuntime().exec("gedit");
// 定义5秒的延迟以便你打开notepad 哈哈
// Robot 开始写
robot.delay(3000);
for (int i = 0; i < 100; i++) {
pressKeyWithShift(robot, KeyEvent.VK_H);
pressKey(robot, KeyEvent.VK_I);
pressKey(robot, KeyEvent.VK_SPACE);
// pressKeyWithShift(robot, KeyEvent.VK_H);
pressKeyWithShift(robot, KeyEvent.VK_I);
pressKey(robot, KeyEvent.VK_SPACE);
pressKey(robot, KeyEvent.VK_A);
pressKey(robot, KeyEvent.VK_M);
pressKey(robot, KeyEvent.VK_SPACE);
pressKey(robot, KeyEvent.VK_T);
pressKey(robot, KeyEvent.VK_H);
pressKey(robot, KeyEvent.VK_E);
pressKey(robot, KeyEvent.VK_SPACE);
pressKey(robot, KeyEvent.VK_J);
pressKey(robot, KeyEvent.VK_A);
pressKey(robot, KeyEvent.VK_V);
pressKey(robot, KeyEvent.VK_A);
pressKey(robot, KeyEvent.VK_SPACE);
pressKey(robot, KeyEvent.VK_R);
pressKey(robot, KeyEvent.VK_O);
pressKey(robot, KeyEvent.VK_B);
pressKey(robot, KeyEvent.VK_O);
pressKey(robot, KeyEvent.VK_T);
// VK_ENTER
pressKey(robot, KeyEvent.VK_ENTER);
// pressKey(robot, KeyEvent.);
}
closeApplication(robot);
// robot.keyPress(KeyEvent.VK_SPACE);
} catch (AWTException e) {
e.printStackTrace();
}
}

}

阅读全文

与java虚拟键盘相关的资料

热点内容
淘宝网络电话叫什么 浏览:231
编程要读哪些书 浏览:134
如何在手机上新建文件夹里添文件 浏览:292
先锋w10刷安卓系统 浏览:787
java设置过期日期 浏览:114
新版本抖音怎么看我的数据比例 浏览:946
什么是3G网络3G的发展史 浏览:269
如何使用ps把图片的文件大小弄小 浏览:880
安卓系统根目录文件夹 浏览:900
手表怎么设置蜂窝网络 浏览:51
旧爱勾搭app还有吗 浏览:141
日外语言编程软件哪个好 浏览:950
小论文发表了但是数据错误怎么办 浏览:952
注册表禁止启动程序运行 浏览:705
网络优化总体流程图 浏览:735
前端程序员简历模板 浏览:706
蜂巢积木编程机器人怎么样 浏览:561
微信小程序tips 浏览:117
油印文件有哪些 浏览:854
java线程买票案例 浏览:672

友情链接