Add commands to text user interface

This commit is contained in:
Rolf Aretz Lap
2017-02-19 14:19:48 +01:00
committed by Laurent Clouet
parent c91bfc38fd
commit 7d2209a0f4
8 changed files with 232 additions and 6 deletions

View File

@@ -21,7 +21,10 @@ package com.sheepit.client.standalone;
import com.sheepit.client.Client;
import com.sheepit.client.Gui;
import com.sheepit.client.Job;
import com.sheepit.client.Stats;
import com.sheepit.client.standalone.text.CLIInputActionHandler;
import com.sheepit.client.standalone.text.CLIInputObserver;
import sun.misc.Signal;
import sun.misc.SignalHandler;
@@ -55,6 +58,11 @@ public class GuiTextOneLine implements Gui {
public void start() {
if (client != null) {
CLIInputObserver cli_input_observer = new CLIInputObserver(client);
cli_input_observer.addListener(new CLIInputActionHandler());
Thread cli_input_observer_thread = new Thread(cli_input_observer);
cli_input_observer_thread.start();
Signal.handle(new Signal("INT"), new SignalHandler() {
@Override
public void handle(Signal signal) {