Skip to content

Commit

Permalink
Tweaked defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
chaorace committed Aug 4, 2015
1 parent 2411ea7 commit 962ff65
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/main/java/Engine.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand All @@ -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
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/Main.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 962ff65

Please sign in to comment.