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

热点内容
美版a1453是什么版本 浏览:517
电脑里的文件夹按照拼音归类 浏览:996
文件管理器怎么把视频压缩成文件 浏览:477
标准化文件名称包括哪些 浏览:85
win10不能读取dll文件 浏览:882
云骑士重装系统找不到usb字样文件 浏览:42
皖事通app社保年限在哪里看 浏览:65
为什么快影显示没网络 浏览:356
华为如何让手机升级提醒红1消失 浏览:345
我爱九九商城app 浏览:587
剑灵苍穹武器升级 浏览:248
微信钱包微粒贷 浏览:654
滚动字幕屏找不到文件 浏览:990
郑州青少年学编程哪个机构比较好 浏览:866
ps文件打开不是彩色的 浏览:781
监控硬盘格式化工具 浏览:512
下载新版本微信6311 浏览:440
有哪些手游可以锻炼编程能力 浏览:602
网络高清监控安装方法 浏览:165
linuxtty切换 浏览:966

友情链接