enabled 'q' for quitting

This commit is contained in:
Arnout Engelen
2004-07-02 10:50:51 +00:00
parent 64717eca86
commit 01bca55737
2 changed files with 11 additions and 2 deletions

View File

@@ -1,5 +1,8 @@
Changelog Changelog
2/07/04 (Arnout)
-enabled 'q' for quitting
29/06/04 (Fabian) <-> 0.5.1 29/06/04 (Fabian) <-> 0.5.1
-Adding forceExit when device is ifdown -Adding forceExit when device is ifdown
(handle was null => segfault) (handle was null => segfault)

View File

@@ -24,7 +24,7 @@ extern "C" {
#include "process.h" #include "process.h"
#include "refresh.h" #include "refresh.h"
bool needrefresh = false; bool needrefresh = true;
unsigned refreshdelay = 1; unsigned refreshdelay = 1;
const char version[] = " version " VERSION "." SUBVERSION "." MINORVERSION; const char version[] = " version " VERSION "." SUBVERSION "." MINORVERSION;
@@ -123,10 +123,11 @@ int main (int argc, char** argv)
} }
#if DEBUG #if DEBUG
#else #else
initscr(); WINDOW * screen = initscr();
raw(); raw();
noecho(); noecho();
cbreak(); cbreak();
nodelay(screen, TRUE);
#endif #endif
getLocal(dev); getLocal(dev);
@@ -152,6 +153,11 @@ int main (int argc, char** argv)
while (1) while (1)
{ {
pcap_dispatch (handle, -1, process, NULL); pcap_dispatch (handle, -1, process, NULL);
switch (getch()) {
case 'q':
quit_cb(0);
break;
}
if (needrefresh) if (needrefresh)
{ {
do_refresh(); do_refresh();