From 962ff65ea51760d5e4197612627d1b9a5552ecac Mon Sep 17 00:00:00 2001 From: chaorace Date: Tue, 4 Aug 2015 15:07:36 -0400 Subject: [PATCH] Tweaked defaults --- src/main/java/Engine.scala | 6 +++--- src/main/java/Main.scala | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/Engine.scala b/src/main/java/Engine.scala index 1486a1d..7d535ed 100644 --- a/src/main/java/Engine.scala +++ b/src/main/java/Engine.scala @@ -23,9 +23,9 @@ class Engine(pollingRate: Option[Double], startupThreshold: Option[Double], give val endPos = new Point2D(MouseInfo.getPointerInfo.getLocation) //If this movement was significant - if(!startPos.almostEquals(endPos, giveupThreshold.getOrElse(2))){ + if(!startPos.almostEquals(endPos, giveupThreshold.getOrElse(1))){ //If this movement was violent - if(!startPos.almostEquals(endPos, startupThreshold.getOrElse(10))){ + if(!startPos.almostEquals(endPos, startupThreshold.getOrElse(7))){ //Use the last polled movement as the new trackball speed lastVector = new Vector2D(startPos, endPos) }else{ @@ -39,7 +39,7 @@ class Engine(pollingRate: Option[Double], startupThreshold: Option[Double], give //Move the mouse according to the last trackball speed robot.mouseMove((endPos.x + lastVector.x).toInt, (endPos.y + lastVector.y).toInt) //Apply friction to trackball - lastVector = new Vector2D(lastVector.x * drag.getOrElse(.98), lastVector.y * drag.getOrElse(.98)) + lastVector = new Vector2D(lastVector.x * drag.getOrElse(.975), lastVector.y * drag.getOrElse(.975)) //If the trackball is almost stopped, stop it if(lastVector.almostEquals(noVector, 2)){ lastVector = noVector diff --git a/src/main/java/Main.scala b/src/main/java/Main.scala index d7d40c0..5e04f23 100644 --- a/src/main/java/Main.scala +++ b/src/main/java/Main.scala @@ -19,14 +19,14 @@ object Main extends App { "Default value (5)" final val startupThresholdDesc = "The lowest amount of movement that can start trackball spinning.\n" + - "Default value (10)" + "Default value (7)" final val giveupThresholdDesc = "The lowest amount of movement that can interrupt trackball spinning.\n" + - "Default value (2)" + "Default value (1)" final val dragDesc = "The rate at which the trackball slows down. 1 eliminates all slowdown.\n" + ">1 values cause the trackball to speed up.\n" + - "Default value (.98)" + "Default value (.975)" //Command line parameters object Args {