diff -rup ~joystick-20051019/utils/jscal.c joystick-20051019/utils/jscal.c --- ~joystick-20051019/utils/jscal.c 2009-05-19 12:07:27.000000000 +0200 +++ joystick-20051019/utils/jscal.c 2009-05-21 00:13:17.000000000 +0200 @@ -61,7 +61,9 @@ struct correction_data { int fd; struct js_corr corr[MAX_AXES]; +struct js_corr corr2[MAX_AXES]; __u8 axmap[ABS_MAX + 1]; +__u8 axmap2[ABS_MAX + 1]; __u16 buttonmap[(KEY_MAX - BTN_MISC + 1)]; char axes, buttons, fuzz; int version; @@ -354,8 +356,7 @@ void print_mappings(char *devicename) exit(1); } if (ioctl(fd, JSIOCGBTNMAP, &buttonmap)) { - perror("jscal: error getting button map"); - exit(1); + buttons=0; } printf("jscal -u %d", axes); @@ -373,6 +374,59 @@ void print_mappings(char *devicename) printf(" %s\n",devicename); } + +void get_axmap2(void) +{ + if (ioctl(fd, JSIOCGAXMAP, &axmap2)) { + perror("jscal: error getting axis map"); + exit(1); + } +} + +int* compare_axes(void) +{ + int axmes[256]; + int i; + int *ax=malloc(axes*sizeof(int)); + for(i=0;i