=== modified file 'demo.c' --- demo.c 2009-11-24 01:30:52 +0000 +++ demo.c 2009-07-15 19:40:44 +0000 @@ -1,5 +1,4 @@ #include -#include #include "termkey.h" @@ -7,27 +6,8 @@ { TERMKEY_CHECK_VERSION; - int mouse = 0; - char buffer[50]; - TermKey *tk; - - int opt; - while((opt = getopt(argc, argv, "m::")) != -1) { - switch(opt) { - case 'm': - if(optarg) - mouse = atoi(optarg); - else - mouse = 1000; - break; - default: - fprintf(stderr, "Usage: %s [-m]\n", argv[0]); - return 1; - } - } - - tk = termkey_new(0, 0); + TermKey *tk = termkey_new(0, 0); if(!tk) { fprintf(stderr, "Cannot allocate termkey instance\n"); @@ -37,9 +17,6 @@ TermKeyResult ret; TermKeyKey key; - if(mouse) - printf("\e[?%dhMouse mode active\n", mouse); - while((ret = termkey_waitkey(tk, &key)) != TERMKEY_RES_EOF) { termkey_snprint_key(tk, buffer, sizeof buffer, &key, TERMKEY_FORMAT_VIM); printf("%s\n", buffer); @@ -50,8 +27,5 @@ break; } - if(mouse) - printf("\e[?%dlMouse mode deactivated\n", mouse); - termkey_destroy(tk); }