当前位置:网站首页>My younger brother Dan Teng, yincuisiting, is a robot human typewriter~~~~~~

My younger brother Dan Teng, yincuisiting, is a robot human typewriter~~~~~~

2022-06-09 18:38:00 Thomas Train spray and smoke

Good brother Shan Teng , Because cuisiting , Machine human typing ~~~~~~

There is no nutrition in the blog content. After reading it, you will not only suffer from malnutrition, but also impotence.

import java.awt.Robot;
import java.awt.event.KeyEvent;
import java.util.stream.IntStream;

/**
 * 
 * @author  Thomas Train spray and smoke 
 *
 */
public class CrazyTypist {
	
    private static final int[] KEYS = {
    	KeyEvent.VK_T, KeyEvent.VK_U, KeyEvent.VK_O,
    	KeyEvent.VK_M, KeyEvent.VK_A,
    	KeyEvent.VK_S, KeyEvent.VK_I,
        KeyEvent.VK_X, KeyEvent.VK_I, KeyEvent.VK_A, KeyEvent.VK_O,
        KeyEvent.VK_H, KeyEvent.VK_U, KeyEvent.VK_O,
        KeyEvent.VK_C, KeyEvent.VK_H, KeyEvent.VK_E
	};

	public static void main(String[] args) throws Exception {
		// establish Windows Command open Notepad 
		Runtime.getRuntime().exec("notepad");
		Robot robot = new Robot();
		robot.delay(1000);

		// Call up Chinese input method 
		robot.keyPress(KeyEvent.VK_CONTROL);
		robot.keyPress(KeyEvent.VK_SHIFT);
		robot.keyRelease(KeyEvent.VK_SHIFT);
		robot.keyRelease(KeyEvent.VK_CONTROL);
		
		
		//  Input text 
		IntStream.of(KEYS).forEach(key -> {
			robot.keyPress(key);
			robot.keyRelease(key);
			robot.delay(200);
		});
		robot.keyPress(KeyEvent.VK_SPACE);
		
	}

}

 

 

原网站

版权声明
本文为[Thomas Train spray and smoke]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/160/202206091815232769.html