Skip to content

Instantly share code, notes, and snippets.

@Wqrld
Created January 28, 2023 12:17
Show Gist options
  • Save Wqrld/e0251fad79e20fbcbf03da2594520162 to your computer and use it in GitHub Desktop.
Save Wqrld/e0251fad79e20fbcbf03da2594520162 to your computer and use it in GitHub Desktop.
// 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