From 30505d5b215d71a2ef06c08972df70dd3cf4922e Mon Sep 17 00:00:00 2001 From: dtookey Date: Sun, 6 Aug 2023 21:00:22 -0400 Subject: [PATCH] doc tweak --- src/main/kotlin/Controllers.kt | 57 ++++++++++++++++++++-------------- 1 file changed, 33 insertions(+), 24 deletions(-) diff --git a/src/main/kotlin/Controllers.kt b/src/main/kotlin/Controllers.kt index 972b49a..47bba77 100644 --- a/src/main/kotlin/Controllers.kt +++ b/src/main/kotlin/Controllers.kt @@ -84,7 +84,7 @@ interface TemporalController { * * @param duration The base sleep duration in ms * @param variance The amount of variance to add in ms. Gets divided in half - * to generate random +/- values. + * and rolled as two separate random numbers to create a normal distribution */ fun sleepWithVariance(duration: Long, variance: Long) { if (duration < 0 || variance <= 1) { @@ -97,6 +97,25 @@ interface TemporalController { } } +/** + * Data class to hold wiggle parameters for mouse movement. + * + * This simple data class holds two integer properties for x and y wiggle amounts. + * These are used when generating simulated mouse movements to add some variance + * and randomness to the coordinates. + * + * For example, if a target destination point is (100, 200), the wiggle params + * might generate an actual movement point like (102, 198) to add some randomness. + * + * @param xWiggle The max amount of variance in x direction. Default 25. + * @param yWiggle The max amount of variance in y direction. Default 25. + */ +data class WiggleParams( + val xWiggle: Int = 25, + val yWiggle: Int = 25 +) + + /** * Interface for controllers that interact with the desktop. * @@ -169,33 +188,23 @@ interface DesktopController { */ interface Automaton : DesktopController, InputController, TemporalController -/** - * Data class to hold wiggle parameters for mouse movement. - * - * This simple data class holds two integer properties for x and y wiggle amounts. - * These are used when generating simulated mouse movements to add some variance - * and randomness to the coordinates. - * - * For example, if a target destination point is (100, 200), the wiggle params - * might generate an actual movement point like (102, 198) to add some randomness. - * - * @param xWiggle The max amount of variance in x direction. Default 25. - * @param yWiggle The max amount of variance in y direction. Default 25. - */ -data class WiggleParams( - val xWiggle: Int = 25, - val yWiggle: Int = 25 -) /** - * Implementation of [DesktopInputController] using [java.awt.Robot]. + * Desktop automation controller using java.awt.Robot. * - * This class implements desktop automation capabilities using the Robot - * class from the AWT library. It provides methods for: + * This provides mouse, keyboard, and timing control capabilities by + * wrapping the java.awt.Robot class. * - * - Getting mouse/pointer info - * - Mouse and keyboard input - * - Adding timing and delays + * Key features: + * + * - Get current mouse/pointer location + * - Move mouse and perform clicks + * - Keyboard presses and hotkeys + * - Scroll wheel motions + * - Sleep/delay methods with variance + * + * RobotController aims to provide a simple and easy to use API for + * automating desktop interactions and workflows. * * @param robot The Robot instance to use. A default is created if not provided. */