How to make keyPress uppercase in Java?
问题 localRobot.keyPress(KeyEvent.VK_F); I have no clue how to make this keypress an uppercase keypress. I attempted to press VK_SHIFT and release afterwards, however that didn't work. Would it work to press the capslock button? If so, how do I do it? Is it just VK_CAPS? 回答1: I believe this might work. It presses the shift button, presses yours then releases. localrobot.keyPress (KeyEvent.VK_SHIFT); localrobot.keyPress (keyCode); //Your keycode(your letter) localrobot.keyRelease (KeyEvent.VK_SHIFT