Anvil Scripting Reference
  • Getting started
    • Introduction
  • 🚀Examples
    • Create a speed overlay
    • Creating a Clock with ImGui
    • Calculating Distances Tool
  • ⚙️ User Settings
    • Make use of our settings API
  • 📦Namespaces
    • engine
    • player
    • key
    • mouse
    • memory
    • draw
    • ImGui
  • 🧪Types
    • Vec2
    • Vec3
    • Vec4
    • playerState
    • refDef
    • clientEntity
    • cg
    • usercmd
    • trace
    • dvar
  • 📄Enums
    • CmdButton
    • ImGuiWindowFlags
    • ImGuiStyleVar
    • ImGuiCol
Powered by GitBook
On this page
  • Methods
  • mouse.isClicked(mouseButton)
  • mouse.isDown(mouseButton)
  • mouse.isReleased(mouseButton)
  1. Namespaces

mouse

Let's you check state of mouse buttons.

PreviouskeyNextmemory

Last updated 2 years ago

Methods

mouse.isClicked(mouseButton)

  • mouseButton - The button to check if it's been clicked

Possible buttons:

  • 0 - Left Mouse Button

  • 1 - Right Mouse Button

  • 2 - Middle Mouse BUtton

  • 3 - Mouse 4

  • 4 - Mouse 5

Example:

if (mouse.isClicked(0)) then
    player.lookAtPosition(engine.getClosestPlayer().lerpOrigin)
end

mouse.isDown(mouseButton)

  • mouseButton - The button to check if it's currently being held down

Possible buttons:

  • 0 - Left Mouse Button

  • 1 - Right Mouse Button

  • 2 - Middle Mouse BUtton

  • 3 - Mouse 4

  • 4 - Mouse 5

Example:

if (mouse.isDown(0)) then
    player.lookAtPosition(engine.getClosestPlayer().lerpOrigin)
end

mouse.isReleased(mouseButton)

  • mouseButton - The button to check if it's being released

Possible buttons:

  • 0 - Left Mouse Button

  • 1 - Right Mouse Button

  • 2 - Middle Mouse BUtton

  • 3 - Mouse 4

  • 4 - Mouse 5

Example:

if (mouse.isReleased(0)) then
    player.lookAtPosition(engine.getClosestPlayer().lerpOrigin)
end
📦
isClicked
isDown
isReleased