X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fjexer%2FTApplication.java;h=9d845be18affeecbd94a91ad2939a9ad8da4fa2c;hb=a83fea2bae838f4b9bbf59ce3832e0e67be41378;hp=4aaab1d05f5ee2b1e1ff6791321b45cbc1b7d5e6;hpb=34a42e784bf1238c6bb2847c52d7c841fcfdef5f;p=nikiroo-utils.git diff --git a/src/jexer/TApplication.java b/src/jexer/TApplication.java index 4aaab1d..9d845be 100644 --- a/src/jexer/TApplication.java +++ b/src/jexer/TApplication.java @@ -69,6 +69,11 @@ public class TApplication { */ private static final boolean debugThreads = false; + /** + * If true, emit events being processed to System.err. + */ + private static final boolean debugEvents = false; + /** * WidgetEventHandler is the main event consumer loop. There are at most * two such threads in existence: the primary for normal case and a @@ -644,10 +649,10 @@ public class TApplication { */ private void metaHandleEvent(final TInputEvent event) { - /* - System.err.printf(String.format("metaHandleEvents event: %s\n", - event)); System.err.flush(); - */ + if (debugEvents) { + System.err.printf(String.format("metaHandleEvents event: %s\n", + event)); System.err.flush(); + } if (quit) { // Do no more processing if the application is already trying @@ -711,7 +716,9 @@ public class TApplication { */ private void primaryHandleEvent(final TInputEvent event) { - // System.err.printf("Handle event: %s\n", event); + if (debugEvents) { + System.err.printf("Handle event: %s\n", event); + } // Special application-wide events ----------------------------------- @@ -804,7 +811,10 @@ public class TApplication { mouse.setX(mouse.getX() - window.getX()); mouse.setY(mouse.getY() - window.getY()); } - // System.err("TApplication dispatch event: %s\n", event); + if (debugEvents) { + System.err.printf("TApplication dispatch event: %s\n", + event); + } window.handleEvent(event); break; }