New script: curve_experiment

This script will update mouse acceleration curves to different settings.

BUG=chromium:359288
TEST=run the script and check if the mouse acceleration on all connected
mice changes.

Change-Id: Ic6f1de87ebbf0d09e744546d8bce75e509db3cb8
Reviewed-on: https://chromium-review.googlesource.com/192932
Reviewed-by: Andrew de los Reyes <[email protected]>
Tested-by: Dennis Kempin <[email protected]>
Commit-Queue: Dennis Kempin <[email protected]>
diff --git a/Makefile b/Makefile
index 459138c..ce78224 100755
--- a/Makefile
+++ b/Makefile
@@ -23,7 +23,8 @@
 	cmt_feedback \
 	evdev_feedback \
 	touch_noise_feedback \
-	send_input_metrics
+	send_input_metrics \
+	curve_experiment
 
 SCRIPTS_DIR=/opt/google/input/
 
diff --git a/curve_experiment b/curve_experiment
new file mode 100755
index 0000000..e9bd0ba
--- /dev/null
+++ b/curve_experiment
@@ -0,0 +1,54 @@
+#!/bin/sh
+
+usage() {
+  echo 'sh curve_experiment {old|new|ubuntu} [parameter]'
+}
+
+
+/opt/google/input/inputcontrol -t mouse -v 'Pointer Sensitivity=0'
+
+case "$1" in
+  old )
+    if [ $# -lt 2 ]; then
+      usage
+      exit 1
+    fi
+    case "$2" in
+      1 )
+        head="127 0.0511811 0.2 0 inf 0 13.2 -825.5"
+        ;;
+      2 )
+        head="127 0.0716535 0.28 0 inf 0 18.48 -1155.7"
+        ;;
+      3 )
+        head="127 0.092126 0.36 0  inf 0 23.76 -1485.9"
+        ;;
+      4 )
+        head="203.2 0.102362 0.4 0 inf 0 42 -4226.56"
+        ;;
+      5 )
+        head="203.2 0.112598 0.44 0 inf 0 46.2 -4649.22"
+        ;;
+      * )
+        usage
+        exit 1
+        ;;
+    esac
+    curve="$head inf 0.000000 1.000000 0.000000 inf 0.000000 1.000000 0.000000 inf 0.000000 1.000000 0.000000 inf 0.000000 1.000000 0.000000 inf 0.000000 1.000000 0.000000 inf 0.000000 1.000000 0.000000 inf 0.000000 1.000000 0.000000 inf 0.000000 1.000000 0.000000 inf 0.000000 1.000000 0.000000 inf 0.000000 1.000000 0.000000 inf 0.000000 1.000000 0.000000 inf 0.000000 1.000000 0.000000 inf 0.000000 1.000000 0.000000 inf 0.000000 1.000000 0.000000 inf 0.000000 1.000000 0.000000 inf 0.000000 1.000000 0.000000 inf 0.000000 1.000000 0.000000 inf 0.000000 1.000000 0.000000"
+    ;;
+  ubuntu )
+    curve="20 0.000000 6.000000 0.000000 inf 0.000000 12.000000 0.000000 inf 0.000000 1.000000 0.000000 inf 0.000000 1.000000 0.000000 inf 0.000000 1.000000 0.000000 inf 0.000000 1.000000 0.000000 inf 0.000000 1.000000 0.000000 inf 0.000000 1.000000 0.000000 inf 0.000000 1.000000 0.000000 inf 0.000000 1.000000 0.000000 inf 0.000000 1.000000 0.000000 inf 0.000000 1.000000 0.000000 inf 0.000000 1.000000 0.000000 inf 0.000000 1.000000 0.000000 inf 0.000000 1.000000 0.000000 inf 0.000000 1.000000 0.000000 inf 0.000000 1.000000 0.000000 inf 0.000000 1.000000 0.000000 inf 0.000000 1.000000 0.000000 inf 0.000000 1.000000 0.000000"
+    ;;
+  new )
+    if [ $# -lt 2 ]; then
+      usage
+      exit 1
+    fi
+    curve=`curl http://edyfox.codecarver.org/php/curve.php?multiplier=$2`
+    ;;
+  * )
+    usage
+    exit 1
+    ;;
+esac
+/opt/google/input/inputcontrol -t mouse -v "Pointer Accel Curve=$curve"
diff --git a/xinput.sh b/xinput.sh
index 3a5b41b..93959da 100755
--- a/xinput.sh
+++ b/xinput.sh
@@ -137,8 +137,8 @@
 
 device_set_prop() {
   assert_eq $# 3
-  log "$XINPUT set-prop \"$1\" \"$2\" \"$3\""
-  $XINPUT set-prop "$1" "$2" "$3"
+  log "$XINPUT set-prop \"$1\" \"$2\" $3"
+  $XINPUT set-prop "$1" "$2" $3
 }
 
 device_get_prop() {