marketplace/productivity

Laptop Numpad for Blender

v0.1.0

@rebindfree

Hold Caps Lock and the number row becomes the numpad, only in Blender.

Gallery

Laptop Numpad for Blender preview

Readme

Blender's views live on the numpad, which laptops do not have. Hold Caps Lock and 0 to 9 send the numpad keys, only while Blender is in front. Caps Lock + 1 is front view, + 3 is right view, + 7 is top view.

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

Settings

  • Hold for the numpad: the layer key. Default Caps Lock, which no longer toggles caps in Blender while the package runs.
  • Sends numpad 0 to Sends numpad 9: the key held with the layer key for each numpad key. Defaults 0 to 9. Key changes apply while the package runs on Rebind 3.9 or newer; on older versions, restart the package.

Limits

  • On macOS, Caps Lock reaches Rebind as a switch, not a held key: the first press turns the numpad layer on and the next press turns it off. Pick another layer key, such as Right Option, if you want hold-for-numpad.
  • The focused program's process name must contain "blender".
  • The macOS start notice appears in Rebind. To see notices on the desktop, turn on Desktop notifications in Rebind's settings.
  • Live use remains unverified on Windows and macOS.

Stop

Stop the package 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

-- Laptop Numpad for Blender: hold the layer key and the number row sends the
-- numpad keys Blender's views live on, only while Blender is in front.

local schema = {
  layer = UI.Keybind("CapsLock", { label = "Hold for the numpad" }),
}
for n = 0, 9 do
  schema[`key{n}`] = UI.Keybind(tostring(n), { label = `Sends numpad {n}` })
end
local cfg = UI.Schema(schema)

-- the layer key does nothing else while this runs
Bind(cfg.layer, function() end)

local function layer()
  return Input.IsDown(cfg.layer)
end

for n = 0, 9 do
  Bind(cfg[`key{n}`], {
    when = layer,
    action = function()
      HID.Combo("Kp" .. n)
    end,
  })
end

function OnStart()
  if _REBIND.platform == "macos" and cfg.layer == "CapsLock" then
    UI.Notify(
      "On macOS, Caps Lock turns the numpad layer on and off instead of being held.",
      "info"
    )
  end
end