Skip to main content

Release a hardware mouse button (:up)

This method is available in versions after 20260805

Declaration

success, error_message = mouse_obj:up(button)

Parameters

  • button Integer or string. Pass a value from 1 through 32 or a predefined button name. See the :down button description.

Returns

  • success Boolean. true if the button is released successfully; otherwise false.
  • error_message String. The reason the operation failed.

Description

Release the specified hardware mouse button.

Example

local m = assert(mouse.connect())
assert(m:down("left"))
assert(m:up("left"))
assert(m:down(13))
assert(m:up(13))
assert(m:disconnect())