Created
January 28, 2023 12:17
-
-
Save Wqrld/e0251fad79e20fbcbf03da2594520162 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// DEV | |
boolean read = false; | |
while(!read) { | |
System.out.print((char) 27 + "[?1000h"); // enable mouse trap | |
try { | |
byte[] in = System.in.readNBytes(6); | |
StringBuilder sb = new StringBuilder(); | |
if(in.length > 0) { | |
if(in[4] == ' ') { | |
System.out.println("down"); | |
} else if (in[4] == '#') { | |
System.out.println("up"); | |
} | |
System.out.println(Arrays.toString(in)); | |
read = true; | |
} | |
} catch (IOException e) { | |
throw new RuntimeException(e); | |
} | |
} | |
System.out.print((char) 27 + "[?1000l"); // disable mouse trap | |
//ENDDEV |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment