World of Warcraft Forever API · C_GamePad.md, for your AI
C_GamePad
25 functions, 6 events, 9 tables, 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
C_GamePad.AddSDLMapping
success = C_GamePad.AddSDLMapping(platform, mapping)
Arguments
platform | ClientPlatformType | |
|---|---|---|
mapping | cstring |
Returns
success | bool |
|---|
C_GamePad.ApplyConfigs
C_GamePad.ApplyConfigs()
C_GamePad.AxisIndexToConfigName
configName = C_GamePad.AxisIndexToConfigName(axisIndex)
Arguments
axisIndex | number |
|---|
Returns
configName | cstring may be nil |
|---|
C_GamePad.ButtonBindingToIndex
buttonIndex = C_GamePad.ButtonBindingToIndex(bindingName)
Arguments
bindingName | cstring |
|---|
Returns
buttonIndex | number may be nil |
|---|
C_GamePad.ButtonIndexToBinding
bindingName = C_GamePad.ButtonIndexToBinding(buttonIndex)
Arguments
buttonIndex | number |
|---|
Returns
bindingName | cstring may be nil |
|---|
C_GamePad.ButtonIndexToConfigName
configName = C_GamePad.ButtonIndexToConfigName(buttonIndex)
Arguments
buttonIndex | number |
|---|
Returns
configName | cstring may be nil |
|---|
C_GamePad.ClearLedColor
C_GamePad.ClearLedColor()
C_GamePad.DeleteConfig
C_GamePad.DeleteConfig(configID)
Arguments
configID | GamePadConfigID |
|---|
C_GamePad.GetActiveDeviceID
deviceID = C_GamePad.GetActiveDeviceID()
Returns
deviceID | number |
|---|
C_GamePad.GetAllConfigIDs
configIDs = C_GamePad.GetAllConfigIDs()
Returns
configIDs | GamePadConfigID[] |
|---|
C_GamePad.GetAllDeviceIDs
deviceIDs = C_GamePad.GetAllDeviceIDs()
Returns
deviceIDs | number[] |
|---|
C_GamePad.GetAllowHoverEventsWithFreeLook
enabled = C_GamePad.GetAllowHoverEventsWithFreeLook()
Returns
enabled | bool |
|---|
C_GamePad.GetCombinedDeviceID
deviceID = C_GamePad.GetCombinedDeviceID()
Returns
deviceID | number |
|---|
C_GamePad.GetConfig
config = C_GamePad.GetConfig(configID)
Arguments
configID | GamePadConfigID |
|---|
Returns
config | GamePadConfig may be nil |
|---|
C_GamePad.GetDeviceMappedState
state = C_GamePad.GetDeviceMappedState([deviceID])
Arguments
deviceID | number may be nil |
|---|
Returns
state | GamePadMappedState may be nil |
|---|
C_GamePad.GetDeviceRawState
rawState = C_GamePad.GetDeviceRawState(deviceID)
Arguments
deviceID | number |
|---|
Returns
rawState | GamePadRawState may be nil |
|---|
C_GamePad.GetLedColor
color = C_GamePad.GetLedColor()
Returns
color | colorRGB |
|---|
C_GamePad.GetPowerLevel
powerLevel = C_GamePad.GetPowerLevel([deviceID])
Arguments
deviceID | number may be nil |
|---|
Returns
powerLevel | GamePadPowerLevel |
|---|
C_GamePad.IsEnabled
enabled = C_GamePad.IsEnabled()
Returns
enabled | bool |
|---|
C_GamePad.SetAllowHoverEventsWithFreeLook
C_GamePad.SetAllowHoverEventsWithFreeLook(enable)
Arguments
enable | bool |
|---|
C_GamePad.SetConfig
C_GamePad.SetConfig(config)
Arguments
config | GamePadConfig |
|---|
C_GamePad.SetLedColor
C_GamePad.SetLedColor(color)
Arguments
color | colorRGB |
|---|
C_GamePad.SetVibration
C_GamePad.SetVibration(vibrationType, intensity)
Arguments
vibrationType | cstring | |
|---|---|---|
intensity | number |
C_GamePad.StickIndexToConfigName
configName = C_GamePad.StickIndexToConfigName(stickIndex)
Arguments
stickIndex | number |
|---|
Returns
configName | cstring may be nil |
|---|
C_GamePad.StopVibration
C_GamePad.StopVibration()
Events
GAME_PAD_ACTIVE_CHANGED
isActive | bool |
|---|
GAME_PAD_ALLOW_HOVER_EVENTS_WITH_FREE_LOOK_CHANGED
enabled | bool |
|---|
GAME_PAD_CONFIGS_CHANGED
No payload.
GAME_PAD_CONNECTED
No payload.
GAME_PAD_DISCONNECTED
No payload.
GAME_PAD_POWER_CHANGED
powerLevel | GamePadPowerLevel |
|---|
Tables
GamePadAxisConfig structure
axis | string | |
|---|---|---|
shift | number may be nil | |
scale | number may be nil | |
deadzone | number may be nil | |
buttonThreshold | number may be nil | |
buttonPos | string may be nil | |
buttonNeg | string may be nil | |
comment | string may be nil |
GamePadConfig structure
comment | string may be nil | |
|---|---|---|
name | string may be nil | |
configID | GamePadConfigID | |
labelStyle | string may be nil | |
rawButtonMappings | GamePadRawButtonMapping[] | |
rawAxisMappings | GamePadRawAxisMapping[] | |
axisConfigs | GamePadAxisConfig[] | |
stickConfigs | GamePadStickConfig[] |
GamePadConfigID structure
vendorID | number may be nil | |
|---|---|---|
productID | number may be nil |
GamePadMappedState structure
name | string | |
|---|---|---|
labelStyle | string | |
buttonCount | number | |
axisCount | number | |
stickCount | number | |
buttons | bool[] | |
axes | number[] | |
sticks | GamePadStick[] |
GamePadRawAxisMapping structure
rawIndex | number | |
|---|---|---|
axis | string may be nil | |
comment | string may be nil |
GamePadRawButtonMapping structure
rawIndex | number | |
|---|---|---|
button | string may be nil | |
axis | string may be nil | |
axisValue | number may be nil | |
comment | string may be nil |
GamePadRawState structure
name | string | |
|---|---|---|
vendorID | number | |
productID | number | |
rawButtonCount | number | |
rawAxisCount | number | |
rawButtons | bool[] | |
rawAxes | number[] |
GamePadStick structure
x | number | |
|---|---|---|
y | number | |
len | number |
GamePadStickConfig structure
stick | string | |
|---|---|---|
axisX | string may be nil | |
axisY | string may be nil | |
deadzone | number may be nil | |
deadzoneX | number may be nil | |
deadzoneY | number may be nil | |
comment | string may be nil |