X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fjexer%2FTApplication.java;h=52bd4356134d9083bddd02e49c40baf96aeecdf5;hb=9edb442b712de01d1b7af81d1d57a29c2c6e7871;hp=5df59d9d4d9def15bfca59c6dd7cd564acc50f85;hpb=4328bb42c10743287dad5cf045f059ad109eb540;p=fanfix.git diff --git a/src/jexer/TApplication.java b/src/jexer/TApplication.java index 5df59d9..52bd435 100644 --- a/src/jexer/TApplication.java +++ b/src/jexer/TApplication.java @@ -249,12 +249,12 @@ public class TApplication { * Run this application until it exits, using stdin and stdout */ public final void run() { - + List events = new LinkedList(); + while (quit == false) { // Timeout is in milliseconds, so default timeout after 1 second // of inactivity. int timeout = getSleepTime(1000); - // std.stdio.stderr.writefln("poll() timeout: %d", timeout); if (eventQueue.size() > 0) { // Do not wait if there are definitely events waiting to be @@ -263,8 +263,9 @@ public class TApplication { } // Pull any pending input events - List events = backend.getEvents(timeout); + backend.getEvents(events, timeout); metaHandleEvents(events); + events.clear(); // Process timers and call doIdle()'s doIdle(); @@ -432,7 +433,8 @@ public class TApplication { assert(sleepTime.total!("msecs")() >= 0); return cast(uint)sleepTime.total!("msecs")(); */ - return 0; + // TODO: fix timers. Until then, come back after 250 millis. + return 250; } }