marketplace/audio

Push to Talk, Unclipped

v0.1.0

@rebindfree

Put push to talk on a mouse button and keep the mic open a moment after release, so your last word gets through.

Gallery

Push to Talk, Unclipped preview

Readme

Push to talk cuts off the end of every callout. This holds F13, which Discord can bind but no keyboard has, while you hold Mouse 4, and keeps it held for a tail you set after you let go, so the last word makes it through.

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

Set up

  1. Start the package.
  2. In Discord, open User Settings > Voice & Video, choose Push to Talk, and record the shortcut by holding Mouse 4. Discord sees F13.
  3. Set Discord's own Push to Talk Release Delay to its lowest, since this package adds the tail.

Settings

  • Hold to talk: default Mouse 4.
  • Key Discord listens for: F13 to F20, default F13. Pick one nothing else uses.
  • Hold after release: 0 to 800 ms, default 250 ms.

Key changes apply while the package runs on Rebind 3.9 or newer. On older versions, restart the package.

Limits

  • The talk button does nothing else while the package runs.
  • Live use remains unverified on Windows, macOS, and Linux.

Stop

Stopping the package releases the key. 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

-- Push to Talk, Unclipped: hold the talk button to hold a key Discord can
-- bind, and keep it held for a short tail after you let go.

local KEYS = { "F13", "F14", "F15", "F16", "F17", "F18", "F19", "F20" }

local cfg = UI.Schema({
  talk = UI.Keybind("Mouse4", { label = "Hold to talk" }),
  output = UI.Select("F13", KEYS, { label = "Key Discord listens for" }),
  tail = UI.Slider(250, {
    min = 0,
    max = 800,
    suffix = " ms",
    label = "Hold after release",
  }),
})

local held = nil
local pending = nil

local function release()
  if held then
    HID.Up(held)
    held = nil
  end
end

Bind(cfg.talk, {
  action = function()
    if pending then
      pending:Cancel()
      pending = nil
    end
    if not held then
      held = cfg.output
      HID.Down(held)
    end
  end,
  release = function()
    pending = After(cfg.tail, function()
      pending = nil
      release()
    end)
  end,
})

function OnStop()
  if pending then
    pending:Cancel()
  end
  release()
end