> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# IGameInputDevice::GetForceFeedbackMotorInfo

> Retrieves information about the force feedback motors on the device, such as their supported axes and effect types.

Retrieves information about the force feedback motors on the device, such as their supported axes and effect types.

## Syntax

```cpp theme={null}
uint32_t GetForceFeedbackMotorInfo(
    uint32_t infoArrayCount,
    GameInputForceFeedbackMotorInfo* infoArray
);
```

### Parameters

*infoArrayCount*   \_In\_\
Type: uint32\_t

Number of elements in *infoArray*. To retrieve all force feedback motors, pass the value returned by [GetForceFeedbackMotorCount](https://docs.xbox.com/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getforcefeedbackmotorcount.md).

*infoArray*   \_Out\_writes\_to\_opt\_(infoArrayCount, return)\
Type: [GameInputForceFeedbackMotorInfo](https://docs.xbox.com/reference/input/gameinput/structs/gameinputforcefeedbackmotorinfo.md)\*

Pointer to an array that receives one structure per force feedback motor. Can be `nullptr`, in which case nothing is written and the method returns 0.

### Return value

Type: uint32\_t

The number of elements written to *infoArray*. This is the smaller of *infoArrayCount* and the number of force feedback motors on the device, or 0 if *infoArray* is `nullptr` or the device has no force feedback motors.

## Remarks

Each element is a [GameInputForceFeedbackMotorInfo](https://docs.xbox.com/reference/input/gameinput/structs/gameinputforcefeedbackmotorinfo.md) structure that describes the axes the corresponding motor drives and the force feedback effect types it supports.

Call [GetForceFeedbackMotorCount](https://docs.xbox.com/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getforcefeedbackmotorcount.md) to get the number of force feedback motors, allocate an array of that size, and then call `GetForceFeedbackMotorInfo` to fill it. If *infoArrayCount* is smaller than the number of force feedback motors, only the first *infoArrayCount* elements are written. The force feedback motors of a device don't change while the device is connected, so you can query them once and cache the result.

Element *i* of the info array describes the motor that has motor index *i*. Use that index as the *motorIndex* parameter of [CreateForceFeedbackEffect](https://docs.xbox.com/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_createforcefeedbackeffect.md), [IsForceFeedbackMotorPoweredOn](https://docs.xbox.com/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_isforcefeedbackmotorpoweredon.md), and [SetForceFeedbackMotorGain](https://docs.xbox.com/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_setforcefeedbackmotorgain.md).

The following example shows how to retrieve the force feedback motors of a device.

```cpp theme={null}
uint32_t motorCount = device->GetForceFeedbackMotorCount();
std::vector<GameInputForceFeedbackMotorInfo> motorInfo(motorCount);
motorInfo.resize(device->GetForceFeedbackMotorInfo(motorCount, motorInfo.data()));

for (uint32_t motorIndex = 0; motorIndex < motorInfo.size(); ++motorIndex)
{
    if (motorInfo[motorIndex].isConstantEffectSupported)
    {
        GameInputForceFeedbackParams params = {};
        params.kind = GameInputForceFeedbackConstant;
        // Fill in the remaining effect parameters...

        Microsoft::WRL::ComPtr<IGameInputForceFeedbackEffect> effect;
        device->CreateForceFeedbackEffect(motorIndex, &params, &effect);
    }
}
```

In GameInput v3 and earlier, this information was available from the `forceFeedbackMotorInfo` member of the [GameInputDeviceInfo](https://docs.xbox.com/reference/input/gameinput/deprecated/structs/gameinputdeviceinfo.md) structure returned by [IGameInputDevice::GetDeviceInfo](https://docs.xbox.com/reference/input/gameinput/deprecated/interfaces/igameinputdevice/methods/igameinputdevice_getdeviceinfo.md).

## Requirements

**Header:** GameInput.h

**Library:** gameinput.lib

**Supported platforms:** Windows, XBOX One family consoles and XBOX Series consoles

## See also

[Overview of GameInput](https://docs.xbox.com/build/core-features/common/input/overviews/input-overview.md)\
[GetForceFeedbackMotorCount](https://docs.xbox.com/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getforcefeedbackmotorcount.md)\
[GameInputForceFeedbackMotorInfo](https://docs.xbox.com/reference/input/gameinput/structs/gameinputforcefeedbackmotorinfo.md)\
[CreateForceFeedbackEffect](https://docs.xbox.com/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_createforcefeedbackeffect.md)\
[IsForceFeedbackMotorPoweredOn](https://docs.xbox.com/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_isforcefeedbackmotorpoweredon.md)\
[SetForceFeedbackMotorGain](https://docs.xbox.com/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_setforcefeedbackmotorgain.md)\
[Force feedback on GameInput](https://docs.xbox.com/build/core-features/common/input/advanced/input-forcefeedback.md)\
[IGameInputDevice](https://docs.xbox.com/reference/input/gameinput/interfaces/igameinputdevice/igameinputdevice.md)

## Version History

| Version | Changes |
| - | - |
| **v4** | Introduced. |


## Related topics

- [GameInputForceFeedbackMotorInfo](https://docs.xbox.com/reference/input/gameinput/structs/gameinputforcefeedbackmotorinfo.md)
- [GameInputFeedbackAxes](https://docs.xbox.com/reference/input/gameinput/enums/gameinputfeedbackaxes.md)
- [Force feedback on GameInput](https://docs.xbox.com/build/core-features/common/input/advanced/input-forcefeedback.md)
- [IGameInputDevice::GetForceFeedbackMotorCount](https://docs.xbox.com/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getforcefeedbackmotorcount.md)
- [IGameInputDevice::GetSupportedRumbleMotors](https://docs.xbox.com/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getsupportedrumblemotors.md)
