Skip to main content

Get the hardware mouse connection state (:is_connected)

This method is available in versions after 20260805

Declaration

connected = mouse_obj:is_connected()

Returns

  • connected Boolean. true while the hardware mouse remains connected; otherwise false.

Description

Get the current connection state of the hardware mouse object.

Example

local m = assert(mouse.connect())
assert(m:is_connected())
assert(m:disconnect())
assert(not m:is_connected())