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.
编码
Robot r=new Robot(); r.keyPress(KeyEvent.VK_CAPS_LOCK); r.keyPress(KeyEvent.VK_V); r.keyPress(KeyEvent.VK_CAPS_LOCK);
打印后不关闭V。我该如何解决?
V
您必须在按下按键后释放按键:
Robot r=new Robot(); r.keyPress(KeyEvent.VK_CAPS_LOCK); r.keyRelease(KeyEvent.VK_CAPS_LOCK); r.keyPress(KeyEvent.VK_V); r.keyRelease(KeyEvent.VK_V); r.keyPress(KeyEvent.VK_CAPS_LOCK); r.keyRelease(KeyEvent.VK_CAPS_LOCK);