WindowsOutsideClickWatcher

class WindowsOutsideClickWatcher(windowSupplier: () -> <Error class: unknown class>?, onOutsideClick: () -> Unit, ignorePointPredicate: (x: Int, y: Int) -> Boolean? = null)

WindowsOutsideClickWatcher using a low-level mouse hook (WH_MOUSE_LL).

Behavior:

  • Listens for global left-button down events.

  • If the click occurs outside the supplied window (and not ignored by predicate), invokes onOutsideClick().

Public signatures are preserved.

Constructors

Link copied to clipboard
constructor(windowSupplier: () -> <Error class: unknown class>?, onOutsideClick: () -> Unit, ignorePointPredicate: (x: Int, y: Int) -> Boolean? = null)

Functions

Link copied to clipboard
open fun close()

Uninstalls the hook and signals the hook thread to exit.

Link copied to clipboard
fun start()

Start the global low-level mouse hook on a dedicated daemon thread.

Link copied to clipboard
fun stop()

Stop the hook (alias to close()).