marketplace/gaming

OSRS WASD Camera

v0.1.0

@rebindfree

Hold Caps Lock and steer the Old School RuneScape camera with WASD, one key for one arrow.

Gallery

OSRS WASD Camera preview

Readme

While you hold Caps Lock, W, A, S and D each become one arrow key, so you can turn the camera without leaving the left side of the keyboard. Let go of Caps Lock and you are typing in chat again.

It runs only while RuneLite or the official Old School RuneScape client is focused.

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

Settings

  • Hold to steer the camera: the layer key. Default Caps Lock, which no longer toggles caps in the game while the package runs.
  • Camera up / left / down / right: the four keys. Defaults W, A, S, D.

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

Before you use it

Jagex allows one action per input. Each key sends exactly one arrow key for as long as you hold it. Do not use anything that plays the game for you.

Limits

  • On macOS, Caps Lock reaches Rebind as a switch, not a held key: the first press turns camera keys on and the next press turns them off. Pick another layer key, such as Right Option, if you want hold-to-steer.
  • On macOS, Rebind needs Screen Recording permission to read window titles.
  • 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. Stopping releases any arrow key still held.

Reviews

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

Source

Version 0.1.0 (current)

main.luau

-- OSRS WASD Camera: while the layer key is held, W, A, S and D each become
-- one arrow key, a strict 1:1 remap. Release it to type in chat again.

local cfg = UI.Schema({
  layer = UI.Keybind("CapsLock", { label = "Hold to steer the camera" }),
  up = UI.Keybind("W", { label = "Camera up" }),
  left = UI.Keybind("A", { label = "Camera left" }),
  down = UI.Keybind("S", { label = "Camera down" }),
  right = UI.Keybind("D", { label = "Camera right" }),
})

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

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

for name, arrow in { up = "Up", left = "Left", down = "Down", right = "Right" } do
  Bind(cfg[name], {
    when = steering,
    action = function()
      HID.Down(arrow)
    end,
    release = function()
      HID.Up(arrow)
    end,
  })
end

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

function OnStop()
  for _, arrow in { "Up", "Left", "Down", "Right" } do
    HID.Up(arrow)
  end
end