May 2, 201510 yr I have everything, I think. How do I get the keys pressed to log "doing shit". Nothing happens currently when I run it.
May 2, 201510 yr Do you see that keyevent use the argument to know when the key has been pressed You talk about mouse pressed title. But in the op it talks about key pressed Edited May 2, 201510 yr by josedpay
May 2, 201510 yr Author Do you see that keyevent use the argument to know when the key has been pressed You talk about mouse pressed title. But in the op it talks about key pressed I meant keyListener Did you register this as a new listener? That is literally everything in my code.
May 2, 201510 yr I meant keyListener That is literally everything in my code. You need to register the listener to your script. Right now you basically made it but didn't attach it to anything.
May 2, 201510 yr Author You need to register the listener to your script. Right now you basically made it but didn't attach it to anything. How do you do that?
May 2, 201510 yr You need to register the listener to your script. Right now you basically made it but didn't attach it to anything.I don't see anything to add key listener.Op I do know in keyboard class you can grab the key Listener class.so use that instance to do want you need
May 2, 201510 yr getBot().getCanvas().addKeyListener(new KeyListener() { @Override public void keyTyped(KeyEvent e) { } @Override public void keyReleased(KeyEvent e) { } @Override public void keyPressed(KeyEvent e) { } });
May 2, 201510 yr getBot().getCanvas().addKeyListener(new KeyListener() { @Override public void keyTyped(KeyEvent e) { } @Override public void keyReleased(KeyEvent e) { } @Override public void keyPressed(KeyEvent e) { } }); Oh nice op seeing as you already implemented the interface. Just do in the onStart getBot().getCanvas().addKeyListener(this); Edited May 2, 201510 yr by josedpay
May 2, 201510 yr getBot().getCanvas().addKeyListener(new KeyListener() { @Override public void keyTyped(KeyEvent e) { } @Override public void keyReleased(KeyEvent e) { } @Override public void keyPressed(KeyEvent e) { } }); Thanks, I paseed tf out l0l
May 3, 201510 yr Author getBot().getCanvas().addKeyListener(new KeyListener() { @Override public void keyTyped(KeyEvent e) { } @Override public void keyReleased(KeyEvent e) { } @Override public void keyPressed(KeyEvent e) { } }); Exactly what I needed. Thank you.
Create an account or sign in to comment