00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #include <stdio.h>
00022 #include <stdlib.h>
00023 #include <unistd.h>
00024
00025 #include <getopt.h>
00026
00027 #include <assert.h>
00028
00029 #include <tbt.h>
00030 #include <keycodes.h>
00031
00032 #include <jutils.h>
00033
00034
00035 TBT tbt;
00036
00037 int main(int argc, char **argv) {
00038 int c, len;
00039
00040 len = tbt.load_ascii( argv[1] );
00041 if(!len) {
00042 fprintf(stderr,"no entries found in file %s\n",argv[1]);
00043 exit(1);
00044 }
00045
00046 TBTEntry *stroke;
00047 char keyname[256];
00048
00049 for(c=1; c<len+1; c++) {
00050
00051
00052 stroke = (TBTEntry*) tbt.buffer->pick(c);
00053 switch(stroke->key) {
00054 case KEY_ENTER: sprintf(keyname,"ENTER"); break;
00055 case KEY_UP: sprintf(keyname,"UP"); break;
00056 case KEY_DOWN: sprintf(keyname,"DOWN"); break;
00057 case KEY_LEFT: sprintf(keyname,"LEFT"); break;
00058 case KEY_RIGHT: sprintf(keyname,"RIGHT"); break;
00059 default: sprintf(keyname, "%c", (int)stroke->key);
00060 }
00061 act("[ %s ] - %lu", keyname, (unsigned long)stroke->msec);
00062
00063
00064 }
00065
00066 exit(0);
00067
00068 }
00069
00070
00071
00072