如何在 linux 或 mac 中显示屏幕键盘?
对于 windows 可以使用这个来完成:
Process p = Runtime.getRuntime() .exec("cmd /C start C:/WINDOWS/osk.exe");
最佳答案
还没有在 Java 中尝试过,但在 Linux 上,您可以使用 xvkbd
作为屏幕键盘。从 Java 运行系统进程与在 Windows 上相同。
String[] command = new String[]{"/bin/sh", "-c", "xvkbd -no-repeat >/dev/null 2>&1 &";
Process p = Runtime.getRuntime().exec(command);
也许你必须调整命令才能执行,我在没有鼠标和键盘的终端 PC 上的 shell 启动脚本中使用它。
还有其他适用于 Linux 的屏幕键盘,如 onboard
或 florence
,它们在外观、资源要求和依赖性方面有所不同。我发现 xvkbd
是最轻的。
关于java - 使用 Java : How to display on-screen keyboard in linux or mac,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28288520/