Advertisement
Corosus

Keypress check

Jul 16th, 2011
226
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. //you'll need: import org.lwjgl.input.Keyboard;
  2.  
  3. //also declare boolean toggleKeyPressed in your java file
  4.  
  5.  
  6. if(Keyboard.isKeyDown(Keyboard.KEY_F7)) {
  7. if(!toggleKeyPressed)
  8. {
  9. toggleKeyPressed = true;
  10. //your code
  11. }
  12. } else {
  13. toggleKeyPressed = false;
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement