skrypton-api / com.waicool20.skrypton.sikulix / ISikuliRegion

ISikuliRegion

interface ISikuliRegion

Interfaces that copies most of the Region APIs Mainly used for allowing easy delegation of SKryptonMatch functions to SKryptonRegion. See here for more information.

Functions

above

abstract fun above(): SKryptonRegion

Gets the region above the top side with same width, the new region extends to the top screen border.

abstract fun above(height: Int): SKryptonRegion

Gets the region above the top side with same width, the new region extends by height pixels.

below

abstract fun below(): SKryptonRegion

Gets the region below the bottom side with same width, the new region extends to the bottom screen border.

abstract fun below(height: Int): SKryptonRegion

Gets the region below the bottom side with same width, the new region extends by height pixels.

click

abstract fun click(): Int

Left click at the region's last successful match, uses center if there is no last match. If region is a match, click targetOffset.

abstract fun <PFRML : Any> click(target: PFRML): Int

Attempts to find the target and click it.

abstract fun <PFRML : Any> click(target: PFRML, modifiers: Int): Int

Attempts to find the target and click it with modifiers.

compareTo

abstract operator fun compareTo(region: Region): Int

Compares the regions in terms of area.

doubleClick

abstract fun doubleClick(): Int
abstract fun <PFRML : Any> doubleClick(target: PFRML): Int
abstract fun <PFRML : Any> doubleClick(target: PFRML, modifiers: Int): Int

Like click but double that.

drag

abstract fun <PFRML : Any> drag(target: PFRML): Int

Initiates a mouse drag action. (Moves mouse to a location and presses without releasing)

dragDrop

abstract fun <PFRML : Any> dragDrop(target: PFRML): Int

Drags from region's last match and drop at given target using left mouse button.

abstract fun <PFRML : Any> dragDrop(t1: PFRML, t2: PFRML): Int

Drag from a position and drop to another using left mouse button.

dropAt

abstract fun <PFRML : Any> dropAt(target: PFRML): Int

Ends a mouse drop action. (Moves mouse to a location and releases the button)

exists

abstract fun <PSI : Any> exists(target: PSI): SKryptonMatch?
abstract fun <PSI : Any> exists(target: PSI, timeout: Double): SKryptonMatch?

Check if target exists (with the default autoWaitTimeout)

find

abstract fun <PSI : Any> find(target: PSI): SKryptonMatch

Finds the given target in the region and returns the best match. If AutoWaitTimeout is set, this is equivalent to wait(). Otherwise only one search attempt will be done.

findAll

abstract fun <PSI : Any> findAll(target: PSI): Iterator<SKryptonMatch>

Finds all occurrences of the given target in the region and returns an Iterator of SKryptonMatch.

getBottomLeft

abstract fun getBottomLeft(): Location

Gets the bottom left location of the region.

getBottomRight

abstract fun getBottomRight(): Location

Gets the bottom right location of the region.

getCenter

abstract fun getCenter(): Location

Gets the center of the region.

getLastMatch

abstract fun getLastMatch(): SKryptonMatch?

Gets the last match matched in this region.

getLastMatches

abstract fun getLastMatches(): Iterator<SKryptonMatch>

Gets last matches matched in this region.

getLocationFromTarget

abstract fun <PSIMRL : Any> getLocationFromTarget(target: PSIMRL): Location

Gets the Location of the target.

getTopLeft

abstract fun getTopLeft(): Location

Gets the top left location of the region.

getTopRight

abstract fun getTopRight(): Location

Gets the top right location of the region.

grow

abstract fun grow(l: Int, r: Int, t: Int, b: Int): SKryptonRegion
abstract fun grow(w: Int, h: Int): SKryptonRegion
abstract fun grow(range: Int): SKryptonRegion

Creates a region grown to the given values in pixels. Negative values can be passed to shrink instead.

abstract fun grow(): SKryptonRegion

Creates a region grown in pixels specified by org.sikuli.basics.Settings.DefaultPadding.

highlight

abstract fun highlight(): SKryptonRegion

Highlights the region.

abstract fun highlight(color: String): SKryptonRegion

Highlights the region with the given color

abstract fun highlight(secs: Int): SKryptonRegion
abstract fun highlight(secs: Float): SKryptonRegion

Highlights the region for the given duration.

abstract fun highlight(secs: Int, color: String): SKryptonRegion
abstract fun highlight(secs: Float, color: String): SKryptonRegion

Highlights the region for the given duration and color.

hover

abstract fun hover(): Int

Move the mouse pointer to region's last successful match, uses center if no last match. If region is a match, move to targetOffset. Same as mouseMove.

abstract fun <PFRML : Any> hover(target: PFRML): Int

Attempts to find the target and move the mouse pointer to it.

intersection

abstract fun intersection(region: Region): SKryptonRegion

Creates a region that is the intersection of the given regions.

keyDown

abstract fun keyDown(keycode: Int): Unit

Presses a specific key.

abstract fun keyDown(keys: String): Unit

Presses the keys specified by the string.

keyUp

abstract fun keyUp(): Unit

Releases all keys

abstract fun keyUp(keycode: Int): Unit

Releases a specific key.

abstract fun keyUp(keys: String): Unit

Releases the keys specified by the string.

left

abstract fun left(): SKryptonRegion

Gets the region left to the left side with same height, the new region extends to the left screen border.

abstract fun left(width: Int): SKryptonRegion

Gets the region left to the left side with same height, the new region extends by width pixels.

mouseDown

abstract fun mouseDown(buttons: Int): Unit

Presses mouse buttons.

mouseMove

abstract fun mouseMove(): Int

Moves the mouse pointer to the region's last successful match. Same as hover.

abstract fun mouseMove(xoff: Int, yoff: Int): Int

Moves the mouse from the current position to the offset position.

abstract fun <PFRML : Any> mouseMove(target: PFRML): Int

Moves the mouse to the given target.

mouseUp

abstract fun mouseUp(): Unit

Releases all mouse buttons.

abstract fun mouseUp(buttons: Int): Unit

Releases mouse buttons.

offset

abstract fun offset(loc: Location): SKryptonRegion

Returns a new Region object, whose upper left corner is relocated adding the location’s x and y value to the respective values of the given region. Width and height are the same. So this clones a region at a different place.

paste

abstract fun paste(text: String): Int

Pastes the given text into the current caret position.

abstract fun <PFRML : Any> paste(target: PFRML, text: String): Int

Pastes the given text into the target.

plus

abstract operator fun plus(region: Region): SKryptonRegion

Same as union.

right

abstract fun right(): SKryptonRegion

Gets the region right to the right side with same height, the new region extends to the right screen border.

abstract fun right(width: Int): SKryptonRegion

Gets the region right to the right side with same height, the new region extends by width pixels.

rightClick

abstract fun rightClick(): Int
abstract fun <PFRML : Any> rightClick(target: PFRML): Int
abstract fun <PFRML : Any> rightClick(target: PFRML, modifiers: Int): Int

Like click but uses right mouse button instead.

setLocation

abstract fun setLocation(loc: Location): SKryptonRegion

Set location of this region.

setROI

abstract fun setROI(): Unit
abstract fun setROI(rect: Rectangle): Unit
abstract fun setROI(region: Region): Unit
abstract fun setROI(X: Int, Y: Int, W: Int, H: Int): Unit

Sets the Region of Interest, mainly used to speed up searches.

type

abstract fun type(text: String): Int
abstract fun type(text: String, modifiers: String): Int
abstract fun type(text: String, modifiers: Int): Int

Types the given text into the current caret position. Only ASCII characters are supported.

abstract fun <PFRML : Any> type(target: PFRML, text: String): Int
abstract fun <PFRML : Any> type(target: PFRML, text: String, modifiers: String): Int
abstract fun <PFRML : Any> type(target: PFRML, text: String, modifiers: Int): Int

Types the given text into the target. Only ASCII characters are supported.

union

abstract fun union(region: Region): SKryptonRegion

Creates a new region containing both regions.

wait

abstract fun <PSI : Any> wait(target: PSI): SKryptonMatch

Waits for the target to appear until the AutoWaitTimeout value is exceeded.

abstract fun <PSI : Any> wait(target: PSI, timeout: Double): SKryptonMatch

Waits for the target to appear or timeout (in second) is passed.

wheel

abstract fun wheel(direction: Int, steps: Int): Int

Spins the mouse wheel.

abstract fun <PFRML : Any> wheel(target: PFRML, direction: Int, steps: Int): Int
abstract fun <PFRML : Any> wheel(target: PFRML, direction: Int, steps: Int, stepDelay: Int): Int

Spins the mouse wheel at the given target

Inheritors

SKryptonMatch

class SKryptonMatch : Match, ISikuliRegion

A class subclassing Match, it is identical for the most part but allows the use of independent mouse and keyboard actions.

SKryptonRegion

open class SKryptonRegion : Region, ISikuliRegion

A class subclassing Region, it is identical for the most part but allows the use of independent mouse and keyboard actions.