@@ -0,0 +1,1544 @@
+%0Apackage com.edinarobotics.utils.gamepad.filters;%0A%0Aimport com.edinarobotics.utils.gamepad.*;%0Aimport com.sun.squawk.util.MathUtils;%0A%0A%0Apublic class ScalingFilter implements GamepadFilter %7B%0A    private final double SLOWDOWN = 2;%0A%0A    public GamepadResult filter(GamepadResult toFilter)%0A    %7B%0A        %0A        double lx = inRange(scale(toFilter.getLeftX()));%0A        double ly = inRange(scale(toFilter.getLeftY()));%0A        double rx = inRange(scale(toFilter.getRightX()));%0A        double ry = inRange(scale(toFilter.getRightY()));%0A        %0A        return new GamepadResult(lx, ly, rx, ry);%0A    %7D%0A    %0A    public GamepadResult filter(GamepadResult toFilter, boolean slowdown)%0A    %7B%0A        GamepadResult toReturn = filter(toFilter);%0A        if(slowdown)%7B%0A        return new GamepadResult(toReturn.getLeftX()/SLOWDOWN, %0A                                 toReturn.getLeftY()/SLOWDOWN, %0A                                 toReturn.getRightX()/SLOWDOWN, %0A                                 toReturn.getRightY()/SLOWDOWN);%0A        %7D%0A        return toReturn;%0A    %7D%0A    %0A    private double scale(double toScale)%0A    %7B%0A        return sgn(toScale)*MathUtils.pow(Math.abs(toScale), 2);%0A    %7D%0A    %0A    private int sgn(double val)%0A    %7B%0A        if(val==0)%7B%0A            return 0;%0A        %7D%0A        if(val%3C0)%7B%0A            return -1;%0A        %7D%0A            return 1;%0A    %7D%0A    %0A    private double inRange(double a)%0A    %7B%0A        if(a%3E1)%0A        %7B%0A            return 1;%0A        %7D%0A        if(a%3C-1)%0A        %7B%0A            return -1;%0A        %7D%0A        return a;%0A    %7D%0A    %0A%7D

Add ScalingFilter to perform quadratic scaling for gamepad joysticks.