2012-01-28 16 views
8

का उपयोग कर जावा में CTRL + Z keyEvent भेजने के लिए कैसे मैं keyevents भेजने के लिए रोबोट कक्षा का उपयोग कर रहा हूँ। मैंने robot.keyPress() फ़ंक्शन का प्रयास किया। लेकिन मुझे पता नहीं लगा कि CTRL + z keyEvent को कैसे भेजा जाए।रोबोट कक्षा

उत्तर

11
robot.keyPress(KeyEvent.VK_CONTROL) 
robot.keyPress(KeyEvent.VK_Z) 
// CTRL+Z is now pressed (receiving application should see a "key down" event.) 
robot.keyRelease(KeyEvent.VK_Z) 
robot.keyRelease(KeyEvent.VK_CONTROL) 
// CTRL+Z is now released (receiving application should now see a "key up" event - as well as a "key pressed" event). 
संबंधित मुद्दे