Skip to content

stormysun513/InterruptableTerminalIO

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

A simple Terminal IO wrapper to make it interruptable.

Usage

InterruptableTermIO termio = new InterruptableTermIO();

while(true)
{   
    String input = null;
    System.out.println("\n\nEnter a string");
    System.out.print(">> ");
    try {
        input = termio.keyboardReadString();
    }   
    catch (InterruptedException e){ 
        e.printStackTrace();
        break;
    }   
    System.out.println("Your input is \"" + input + "\"");
}   
System.out.println("Main thread is interrupted.");

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages