# HG changeset patch # User Atul Varma # Date 1203908263 21600 # Node ID 5477703cfb738ed84632aa855399fca47c765f45 # Parent df28ad0875c4951f52082cdddcccead0d8a9d560 Made some of the messages in the key notifier display only if DEBUG is defined. diff -r df28ad0875c4 -r 5477703cfb73 src/EnsoKeyNotifier.m --- a/src/EnsoKeyNotifier.m Sun Feb 24 20:48:51 2008 -0600 +++ b/src/EnsoKeyNotifier.m Sun Feb 24 20:57:43 2008 -0600 @@ -8,6 +8,12 @@ #define QUASIMODE_KEY kCGEventFlagMaskAlternate +#ifdef DEBUG +#define DEBUG_MSG( msg ) printf( msg ); +#else +#define DEBUG_MSG( msg ) +#endif + NSDistributedNotificationCenter *center; CGKeyCode lastQuasimodalKeyCode; @@ -59,7 +65,7 @@ { CGEventRef event[2]; - printf( "Re-posting single keypress\n" ); + DEBUG_MSG( "Re-posting single keypress\n" ); event[0] = CGEventCreateKeyboardEvent( NULL, @@ -82,7 +88,7 @@ CFRelease( event[0] ); CFRelease( event[1] ); } - printf( "Exit quasimode\n" ); + DEBUG_MSG( "Exit quasimode\n" ); } } else { if ( flags & QUASIMODE_KEY ) @@ -97,7 +103,7 @@ inQuasimode = YES; passOnEvent = NO; numQuasimodalKeyDowns = 0; - printf( "Enter quasimode\n" ); + DEBUG_MSG( "Enter quasimode\n" ); } else { sendSomeKeyEvent(); } @@ -196,6 +202,7 @@ kCFRunLoopDefaultMode ); + printf( "Greetings from %s.\n", argv[0] ); printf( "Please make sure either of the following is true:\n\n" " (1) This program is running with super-user privileges.\n" " (2) Access for assistive devices is enabled in the \n"