导航:首页 > 编程语言 > 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虚拟键盘相关的资料

热点内容
什么的网络填 浏览:567
查国家文件去哪里查 浏览:722
手机上怎么发文件 浏览:64
数据分析过程6个步骤是哪些 浏览:622
baksmali最新版本 浏览:666
小米查找手机在哪个文件夹 浏览:906
编程进销存用什么语言 浏览:412
linux下获取目录下所有文件名 浏览:422
note5怎么退出应用程序 浏览:71
qq个性群网名 浏览:224
激荡三十年版本哪个好 浏览:950
移动内网怎么传文件夹 浏览:581
extjslicense 浏览:338
文件夹变成ink 浏览:124
七彩虹h110装机教程 浏览:351
word三个减号回车 浏览:844
生存之旅22041升级补丁 浏览:825
强行进入别人微信空间 浏览:208
win81有线未识别网络 浏览:616
a7m3图片配置文件视频 浏览:471

友情链接