World of Warcraft Forever API · Input.md, for your AI
Input (global functions)
31 functions, 1 events, as Blizzard documents them for Forever 1.60.1 (70959).
Making an addon with an 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. It checks every call against this API before you try it in the game, then publishes it here. How it works.
Functions
GetCursorCenterPosition
posX, posY = GetCursorCenterPosition()
Returns
posX | number | |
|---|---|---|
posY | number |
GetCursorDelta
deltaX, deltaY = GetCursorDelta()
Returns
deltaX | number | |
|---|---|---|
deltaY | number |
GetCursorPosition
posX, posY = GetCursorPosition()
Returns
posX | number | |
|---|---|---|
posY | number |
GetMouseButtonClicked
buttonName = GetMouseButtonClicked()
Returns
buttonName | cstring |
|---|
GetMouseButtonName
buttonName = GetMouseButtonName(button)
Arguments
button | mouseButton |
|---|
Returns
buttonName | cstring |
|---|
GetMouseFoci
region = GetMouseFoci()
Returns
region | ScriptRegion[] |
|---|
GetStringFromModifiers
modifierString = GetStringFromModifiers(modifiers)
Arguments
modifiers | number |
|---|
Returns
modifierString | string |
|---|
IsAltKeyDown
down = IsAltKeyDown()
Returns
down | bool |
|---|
IsControlKeyDown
down = IsControlKeyDown()
Returns
down | bool |
|---|
IsCursorVisible
visible = IsCursorVisible()
Returns
visible | bool |
|---|
IsKeyDown
down = IsKeyDown(keyOrMouseName, [excludeBindingState])
Arguments
keyOrMouseName | cstring | |
|---|---|---|
excludeBindingState | bool default false |
Returns
down | bool may be nil |
|---|
IsLeftAltKeyDown
down = IsLeftAltKeyDown()
Returns
down | bool |
|---|
IsLeftControlKeyDown
down = IsLeftControlKeyDown()
Returns
down | bool |
|---|
IsLeftMetaKeyDown
down = IsLeftMetaKeyDown()
Returns
down | bool |
|---|
IsLeftShiftKeyDown
down = IsLeftShiftKeyDown()
Returns
down | bool |
|---|
IsMetaKeyDown
down = IsMetaKeyDown()
Returns
down | bool |
|---|
IsModifierKeyDown
down = IsModifierKeyDown()
Returns
down | bool |
|---|
IsMouseButtonDown
down = IsMouseButtonDown([button])
Arguments
button | mouseButton may be nil |
|---|
Returns
down | bool |
|---|
IsRightAltKeyDown
down = IsRightAltKeyDown()
Returns
down | bool |
|---|
IsRightControlKeyDown
down = IsRightControlKeyDown()
Returns
down | bool |
|---|
IsRightMetaKeyDown
down = IsRightMetaKeyDown()
Returns
down | bool |
|---|
IsRightShiftKeyDown
down = IsRightShiftKeyDown()
Returns
down | bool |
|---|
IsShiftKeyDown
down = IsShiftKeyDown()
Returns
down | bool |
|---|
IsUsingGamepad
down = IsUsingGamepad()
Returns
down | bool |
|---|
IsUsingMouse
down = IsUsingMouse()
Returns
down | bool |
|---|
MakeModifiers
modifiers = MakeModifiers()
Returns
modifiers | number |
|---|
SetCursorPosition
SetCursorPosition(xPosition, yPosition)
Insecure code can only call this once in response to gamepad input hardware events.
Arguments
xPosition | uiUnit | |
|---|---|---|
yPosition | uiUnit |
SimulateMouseClick
SimulateMouseClick(button)
Effectively the same as SimulateMouseDown plus SimulateMouseUp and consumes limited input for both.
Arguments
button | mouseButton |
|---|
SimulateMouseDown
SimulateMouseDown(button)
Insecure code can only call this once in response to gamepad input hardware events.
Arguments
button | mouseButton |
|---|
SimulateMouseUp
SimulateMouseUp(button)
Insecure code can only call this once in response to gamepad input hardware events.
Arguments
button | mouseButton |
|---|
SimulateMouseWheel
SimulateMouseWheel(delta)
Insecure code can only call this once in response to gamepad input hardware events.
Arguments
delta | number |
|---|
Events
INPUT_DEVICE_INTERFACE_TRANSITION
newMode | InputDeviceInterfaceType | |
|---|---|---|
oldMode | InputDeviceInterfaceType |