marketplace/accessibility

Click Assist

v0.1.0

@rebindfree

Drag without holding the button, or turn one press into a timed hold or a double click.

Gallery

Click Assist preview

Readme

Three ways to use a mouse button for hands that can press but not hold:

  • Toggle Click: one tap holds the button down, the next tap lets it go, so you can drag without holding.
  • Hold Assist: one tap holds the button for the time you set.
  • Double Click: one tap clicks twice.

Needs Rebind 3.5.0 or newer on Windows, macOS, or Linux. No extra permissions.

Settings

  • Button to assist: default Mouse 1 (left button). Changing it takes effect after you restart the package.
  • Mode: Toggle Click, Hold Assist, or Double Click. Mode and timing changes apply right away.
  • Hold Assist length: 100 to 3000 ms.
  • Double Click gap: 20 to 200 ms between the two clicks.

Limits

  • While the package runs, the chosen button always goes through the selected mode; switch the mode or stop the package to click normally.
  • Toggle Click shows a "Button held" and "Button released" notice in Rebind. To see notices on the desktop, turn on Desktop notifications in Rebind's settings. Two notices within a second show only the first, and Linux shows them only inside Rebind.
  • Dragging while latched is unverified on macOS. Live use remains unverified on Windows, macOS, and Linux.

Stop

Stopping the package releases a latched button. Stop it from the editor toolbar, or press Left Ctrl + Left Alt + K to stop all scripts.

Reviews

No reviews yet. Be the first, from the app.

Source

Version 0.1.0 (current)

main.luau

-- Click Assist: three ways to press a button for hands that can press but
-- not hold. Toggle Click latches it, Hold Assist turns a tap into a timed
-- hold, Double Click turns one press into two.

local cfg = UI.Schema({
  button = UI.Keybind("Mouse1", { label = "Button to assist" }),
  mode = UI.Select(
    "Toggle Click",
    { "Toggle Click", "Hold Assist", "Double Click" },
    { label = "Mode" }
  ),
  hold_time = UI.Slider(500, {
    min = 100,
    max = 3000,
    suffix = " ms",
    label = "Hold Assist length",
  }),
  double_gap = UI.Slider(50, {
    min = 20,
    max = 200,
    suffix = " ms",
    label = "Double Click gap",
  }),
})

local button = cfg.button
local latched = false

Bind(button, {
  action = function()
    if cfg.mode == "Toggle Click" then
      latched = not latched
      if latched then
        HID.Down(button)
        UI.Notify("Button held", "info")
      else
        HID.Up(button)
        UI.Notify("Button released", "info")
      end
    elseif cfg.mode == "Hold Assist" then
      Run(function()
        HID.Down(button)
        Sleep(cfg.hold_time)
        HID.Up(button)
      end)
    else
      Run(function()
        HID.Press(button, 30)
        Sleep(cfg.double_gap)
        HID.Press(button, 30)
      end)
    end
  end,
  release = function() end,
})

function OnStop()
  if latched then
    HID.Up(button)
  end
end