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-24 21:16:48.000000000 +0200 @@ -62,6 +62,7 @@ struct correction_data { int fd; struct js_corr corr[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 +355,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 +373,44 @@ 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); + } +} + +void correct_axes(void) +{ + int axmes[ABS_MAX + 1]; + struct js_corr corr_tmp[MAX_AXES]; + int i; + int ax[axes]; + //Create remapping table + for(i=0;i