Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Catch XY

The km.catch_xy([duration], [include_sw_input]) command is used to find the amount of x/y mouse input over the last duration of time.

The parameter duration is a value in milliseconds up to 1000, declaring how far back in time to sum the x/y input.

The parameter include_sw_input is an optional boolean (true or false, with any capitalization), declaring whether to include both software and hardware input (true), or purely hardware input (false, or no parameter).

The command returns the summed input in the following format: (x, y).

Examples

Summing the Last Second of Hardware Input

Input:

km.catch_xy(1000)  # 1000ms = 1 second = max duration

Output:

km.catch_xy(1000)
(500, -500)        # The mouse moved 500 to the right, and 500 up in the last second.
>>>

Summing the Last 10 MilliSeconds of Software and Hardware Input

Input:

km.catch_xy(10, true)    # 10ms, include software input

Output:

km.catch_xy(10, true)
(-3, 10)           # The mouse moved 3 left, and 10 up in the last 10ms.
>>>