Advertisement
Guest User

Untitled

a guest
May 10th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.81 KB | None | 0 0
  1. void keyTyped() {
  2.  
  3. if(escolha==0){
  4. if(keyPressed && key=='1'){
  5. escolha=1;
  6. }
  7.  
  8. if(keyPressed && key=='2'){
  9. escolha=2;
  10. }
  11.  
  12. }
  13.  
  14. if(escolha==1){
  15.  
  16. if(keyPressed && key=='\n' && flagkey==0) {send("registar " + username + " " + password + "\n");println(username);println(password);}
  17.  
  18. else if(keyPressed && key=='\n' && flagkey==1) {
  19. flagkey=0;
  20. }
  21.  
  22. else if(keyPressed && key==BACKSPACE && flagkey==1){
  23. if(username.length()>0){
  24. username = username.substring(0, username.length() - 1);}
  25. }
  26.  
  27. else if(keyPressed && key!='1' && flagkey==1){
  28. username+=key;
  29. }
  30.  
  31. else if(keyPressed && key==BACKSPACE && flagkey==0){
  32. if(password.length()>0){
  33. password = password.substring(0, password.length() - 1);
  34. passaux = passaux.substring(0, passaux.length() - 1);}
  35. }
  36.  
  37. else if(keyPressed && flagkey==0){
  38. password+=key;
  39. passaux+='*';
  40. }
  41.  
  42. }
  43.  
  44. if(escolha==2){
  45.  
  46.  
  47. if(keyPressed && key=='\n' && flagkey2==0) {send("login " + username2 + " " + password2 + "\n");}
  48.  
  49. else if(keyPressed && key=='\n' && flagkey2==1) {
  50. flagkey2=0;
  51. }
  52.  
  53. else if(keyPressed && key==BACKSPACE && flagkey2==1){
  54. if(username2.length()>0){
  55. username2 = username2.substring(0, username2.length() - 1);}
  56. }
  57.  
  58. else if(keyPressed && key!='2' && flagkey2==1){
  59. username2+=key;
  60. }
  61.  
  62. else if(keyPressed && key==BACKSPACE && flagkey==2){
  63. if(password2.length()>0){
  64. password2 = password2.substring(0, password2.length() - 1);
  65. passaux2 = passaux2.substring(0, passaux2.length() - 1);}
  66. }
  67.  
  68. else if(keyPressed && flagkey2==0){
  69. password2+=key;
  70. passaux2+='*';
  71. }
  72.  
  73. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement