# Input (global functions): World of Warcraft Forever API

Forever 1.60.1 (70959), Interface 16001, Lua 5.1, from Blizzard's own API documentation. Page: https://wowaddons.gg/forever-api/Input

## Functions

### GetCursorCenterPosition

```lua
posX, posY = GetCursorCenterPosition()
```

Returns:
- `posX`: number
- `posY`: number

### GetCursorDelta

```lua
deltaX, deltaY = GetCursorDelta()
```

Returns:
- `deltaX`: number
- `deltaY`: number

### GetCursorPosition

```lua
posX, posY = GetCursorPosition()
```

Returns:
- `posX`: number
- `posY`: number

### GetMouseButtonClicked

```lua
buttonName = GetMouseButtonClicked()
```

Returns:
- `buttonName`: cstring

### GetMouseButtonName

```lua
buttonName = GetMouseButtonName(button)
```

Arguments:
- `button`: mouseButton

Returns:
- `buttonName`: cstring

### GetMouseFoci

```lua
region = GetMouseFoci()
```

Returns:
- `region`: ScriptRegion[]

### GetStringFromModifiers

```lua
modifierString = GetStringFromModifiers(modifiers)
```

Arguments:
- `modifiers`: number

Returns:
- `modifierString`: string

### IsAltKeyDown

```lua
down = IsAltKeyDown()
```

Returns:
- `down`: bool

### IsControlKeyDown

```lua
down = IsControlKeyDown()
```

Returns:
- `down`: bool

### IsCursorVisible

```lua
visible = IsCursorVisible()
```

Returns:
- `visible`: bool

### IsKeyDown

```lua
down = IsKeyDown(keyOrMouseName, [excludeBindingState])
```

Arguments:
- `keyOrMouseName`: cstring
- `excludeBindingState`: bool, default false

Returns:
- `down`: bool, may be nil

### IsLeftAltKeyDown

```lua
down = IsLeftAltKeyDown()
```

Returns:
- `down`: bool

### IsLeftControlKeyDown

```lua
down = IsLeftControlKeyDown()
```

Returns:
- `down`: bool

### IsLeftMetaKeyDown

```lua
down = IsLeftMetaKeyDown()
```

Returns:
- `down`: bool

### IsLeftShiftKeyDown

```lua
down = IsLeftShiftKeyDown()
```

Returns:
- `down`: bool

### IsMetaKeyDown

```lua
down = IsMetaKeyDown()
```

Returns:
- `down`: bool

### IsModifierKeyDown

```lua
down = IsModifierKeyDown()
```

Returns:
- `down`: bool

### IsMouseButtonDown

```lua
down = IsMouseButtonDown([button])
```

Arguments:
- `button`: mouseButton, may be nil

Returns:
- `down`: bool

### IsRightAltKeyDown

```lua
down = IsRightAltKeyDown()
```

Returns:
- `down`: bool

### IsRightControlKeyDown

```lua
down = IsRightControlKeyDown()
```

Returns:
- `down`: bool

### IsRightMetaKeyDown

```lua
down = IsRightMetaKeyDown()
```

Returns:
- `down`: bool

### IsRightShiftKeyDown

```lua
down = IsRightShiftKeyDown()
```

Returns:
- `down`: bool

### IsShiftKeyDown

```lua
down = IsShiftKeyDown()
```

Returns:
- `down`: bool

### IsUsingGamepad

```lua
down = IsUsingGamepad()
```

Returns:
- `down`: bool

### IsUsingMouse

```lua
down = IsUsingMouse()
```

Returns:
- `down`: bool

### MakeModifiers

```lua
modifiers = MakeModifiers()
```

Returns:
- `modifiers`: number

### SetCursorPosition

```lua
SetCursorPosition(xPosition, yPosition)
```

Insecure code can only call this once in response to gamepad input hardware events.

Arguments:
- `xPosition`: uiUnit
- `yPosition`: uiUnit

### SimulateMouseClick

```lua
SimulateMouseClick(button)
```

Effectively the same as SimulateMouseDown plus SimulateMouseUp and consumes limited input for both.

Arguments:
- `button`: mouseButton

### SimulateMouseDown

```lua
SimulateMouseDown(button)
```

Insecure code can only call this once in response to gamepad input hardware events.

Arguments:
- `button`: mouseButton

### SimulateMouseUp

```lua
SimulateMouseUp(button)
```

Insecure code can only call this once in response to gamepad input hardware events.

Arguments:
- `button`: mouseButton

### SimulateMouseWheel

```lua
SimulateMouseWheel(delta)
```

Insecure code can only call this once in response to gamepad input hardware events.

Arguments:
- `delta`: number

## Events

### INPUT_DEVICE_INTERFACE_TRANSITION

Payload, after the event's name:
- `newMode`: InputDeviceInterfaceType
- `oldMode`: InputDeviceInterfaceType

---
Make an addon with your AI: tell it "Read https://wowaddons.gg/agents.md, then make me a World of Warcraft Forever addon that …, try it with me in the game, and publish it."
