clean up primary loops.

main
sigonasr2, Sig, Sigo 3 years ago
parent 348c5cc051
commit c6d18273a9
  1. 38
      src/sig/SigTerm.java
  2. BIN
      target/classes/sig/SigTerm.class

@ -168,20 +168,8 @@ public class SigTerm{
System.out.println(RESET);
}
static void RefreshScreen() {
CursorLineDown(1);
ScrollUp(1);
}
public static void main(String[] args) {
static void HandleInput(NonBlockingReader r) {
try {
Terminal term = org.jline.terminal.TerminalBuilder.terminal();
term.enterRawMode();
NonBlockingReader r = term.reader();
System.out.println(term.getWidth()+"x"+term.getHeight()+" size detected.");
System.out.println("Done!");
RunTest();
while (RUNNING) {
int ch = r.peek(250);
if (ch!=NonBlockingReader.READ_EXPIRED) {
if (!is27&&!is91&&ch==27) {
@ -215,8 +203,32 @@ public class SigTerm{
}
r.read();
}
} catch (IOException e) {
e.printStackTrace();
}
}
static void Run(NonBlockingReader r) {
while (RUNNING) {
HandleInput(r);
RefreshScreen();
}
}
static void RefreshScreen() {
CursorLineDown(1);
ScrollUp(1);
}
public static void main(String[] args) {
try {
Terminal term = org.jline.terminal.TerminalBuilder.terminal();
term.enterRawMode();
NonBlockingReader r = term.reader();
System.out.println(term.getWidth()+"x"+term.getHeight()+" size detected.");
System.out.println("Done!");
//RunTest();
Run(r);
r.shutdown();
term.close();
} catch (IOException e) {

Binary file not shown.
Loading…
Cancel
Save