August 4, 20169 yr So this is a snippet I wrote as a reply to a thread, but it's pretty buried and some people may find it useful: public final void typeStringInstant(final String output){ for(int i = 0; i < output.length(); i ++){ getBot().getKeyEventHandler().generateBotKeyEvent(KEY_TYPED, System.currentTimeMillis(), 0, VK_UNDEFINED, output.charAt(i)); } getBot().getKeyEventHandler().generateBotKeyEvent(KEY_TYPED, System.currentTimeMillis(), 0, VK_UNDEFINED, (char) VK_ENTER); } Edited January 29, 20179 yr by Explv
March 7, 20178 yr Hey man I get this KEY_TYPED cannot be resolved to a variable for obviously KEY_TYPED has it slightly changed ? @Explv
March 7, 20178 yr Author 2 hours ago, whipz said: Hey man I get this KEY_TYPED cannot be resolved to a variable for obviously KEY_TYPED has it slightly changed ? @Explv You have to import it from this class https://docs.oracle.com/javase/7/docs/api/java/awt/event/KeyEvent.html
March 7, 20178 yr import java.awt.event.KeyEvent; ? @Explv 14 minutes ago, Explv said: You have to import it from this class https://docs.oracle.com/javase/7/docs/api/java/awt/event/KeyEvent.html
March 9, 20178 yr On 3/7/2017 at 7:44 PM, Explv said: You have to import it from this class https://docs.oracle.com/javase/7/docs/api/java/awt/event/KeyEvent.html I still cant get it to work even with that import i still get same error /:
March 9, 20178 yr Author 9 hours ago, whipz said: I still cant get it to work even with that import i still get same error /: With that import you would have to change it to KeyEvent.KEY_TYPED.....
March 23, 20178 yr On 3/8/2017 at 7:14 PM, whipz said: I still cant get it to work even with that import i still get same error /: I believe a static import would solve that problem. Use static imports sparingly however
Create an account or sign in to comment