Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我可以导入什么来模拟java中的键盘按下?
因此,例如,我可以使用它来制作一个程序,以便在事件发生时自动按下“a”键。
你需要的一切都在java.awt.Robot
java.awt.Robot
例子:
Robot robot = new Robot(); robot.keyPress(KeyEvent.VK_A);