<!--
{
  "documentType" : "article",
  "framework" : "ForceFeedback",
  "identifier" : "/documentation/ForceFeedback/forcefeedback-h",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "ForceFeedback.h"
}
-->

# ForceFeedback.h

Public Interfaces to the Force Feedback implementation in macOS.

## Discussion

The Force Feedback API allows developers to control Force Feedback devices attached to the system. It is a distilled version of the Force Feedback functionality found in Microsoft’s DirectInput API. Developers familiar with that API should find this API to be similar.

### Included Headers

- <CoreFoundation/CoreFoundation.h>
- <CoreFoundation/CFPlugInCOM.h>
- <MacTypes.h>
- <IOKit/IOTypes.h>
- <ForceFeedback/ForceFeedbackConstants.h>

## Topics

### Miscellaneous

[`func FFCreateDevice(io_service_t, UnsafeMutablePointer<FFDeviceObjectReference?>!) -> HRESULT`](/documentation/ForceFeedback/FFCreateDevice(_:_:))

Creates a new API device object from an OS object in preparation to use the device for force feedback.

[`func FFDeviceCreateEffect(FFDeviceObjectReference!, CFUUID!, UnsafeMutablePointer<FFEFFECT>!, UnsafeMutablePointer<FFEffectObjectReference?>!) -> HRESULT`](/documentation/ForceFeedback/FFDeviceCreateEffect(_:_:_:_:))

Creates and initializes an instance of an effect identified by the effect UUID on the device.

[`func FFDeviceEscape(FFDeviceObjectReference!, UnsafeMutablePointer<FFEFFESCAPE>!) -> HRESULT`](/documentation/ForceFeedback/FFDeviceEscape(_:_:))

Sends a hardware-specific command to the device.

[`func FFDeviceGetForceFeedbackCapabilities(FFDeviceObjectReference!, UnsafeMutablePointer<FFCAPABILITIES>!) -> HRESULT`](/documentation/ForceFeedback/FFDeviceGetForceFeedbackCapabilities(_:_:))

Retrieves the device’s force feedback capabilities.

[`func FFDeviceGetForceFeedbackProperty(FFDeviceObjectReference!, FFProperty, UnsafeMutableRawPointer!, IOByteCount) -> HRESULT`](/documentation/ForceFeedback/FFDeviceGetForceFeedbackProperty(_:_:_:_:))

Gets properties that define the device behavior.

[`func FFDeviceGetForceFeedbackState(FFDeviceObjectReference!, UnsafeMutablePointer<FFState>!) -> HRESULT`](/documentation/ForceFeedback/FFDeviceGetForceFeedbackState(_:_:))

Retrieves the state of the device’s force feedback system.

[`func FFDeviceReleaseEffect(FFDeviceObjectReference!, FFEffectObjectReference!) -> HRESULT`](/documentation/ForceFeedback/FFDeviceReleaseEffect(_:_:))

Disposes of an API effect object created with FFDeviceCreateEffect.

[`func FFDeviceSendForceFeedbackCommand(FFDeviceObjectReference!, FFCommandFlag) -> HRESULT`](/documentation/ForceFeedback/FFDeviceSendForceFeedbackCommand(_:_:))

Sends a command to the device’s force feedback system.

[`func FFDeviceSetCooperativeLevel(FFDeviceObjectReference!, UnsafeMutableRawPointer!, FFCooperativeLevelFlag) -> HRESULT`](/documentation/ForceFeedback/FFDeviceSetCooperativeLevel(_:_:_:))

Function is unimplemented in version 1.0 of this API

[`func FFDeviceSetForceFeedbackProperty(FFDeviceObjectReference!, FFProperty, UnsafeMutableRawPointer!) -> HRESULT`](/documentation/ForceFeedback/FFDeviceSetForceFeedbackProperty(_:_:_:))

Retrieves the device’s force feedback capabilities.

[`func FFEffectDownload(FFEffectObjectReference!) -> HRESULT`](/documentation/ForceFeedback/FFEffectDownload(_:))

Places the effect on the device. If the effect is already on the device, the existing effect is updated to match the values set by the FFEffectSetParameters method.

[`func FFEffectEscape(FFEffectObjectReference!, UnsafeMutablePointer<FFEFFESCAPE>!) -> HRESULT`](/documentation/ForceFeedback/FFEffectEscape(_:_:))

Sends a hardware-specific command to the driver.

[`func FFEffectGetEffectStatus(FFEffectObjectReference!, UnsafeMutablePointer<FFEffectStatusFlag>!) -> HRESULT`](/documentation/ForceFeedback/FFEffectGetEffectStatus(_:_:))

Sends a hardware-specific command to the driver.

[`func FFEffectGetParameters(FFEffectObjectReference!, UnsafeMutablePointer<FFEFFECT>!, FFEffectParameterFlag) -> HRESULT`](/documentation/ForceFeedback/FFEffectGetParameters(_:_:_:))

Retrieves information about an effect.

[`func FFEffectSetParameters(FFEffectObjectReference!, UnsafeMutablePointer<FFEFFECT>!, FFEffectParameterFlag) -> HRESULT`](/documentation/ForceFeedback/FFEffectSetParameters(_:_:_:))

Sets the characteristics of an effect.

[`func FFEffectStart(FFEffectObjectReference!, UInt32, FFEffectStartFlag) -> HRESULT`](/documentation/ForceFeedback/FFEffectStart(_:_:_:))

Begins playing an effect. If the effect is already playing, it is restarted from the beginning. If the effect has not been downloaded or has been modified since its last download, it is downloaded before being started. This default behavior can be suppressed by passing the FFES_NODOWNLOAD flag.

[`func FFEffectStop(FFEffectObjectReference!) -> HRESULT`](/documentation/ForceFeedback/FFEffectStop(_:))

Stops playing an effect.

[`func FFEffectUnload(FFEffectObjectReference!) -> HRESULT`](/documentation/ForceFeedback/FFEffectUnload(_:))

Removes the effect from the device. If the effect is playing, it is automatically stopped before it is unloaded.

[`func FFIsForceFeedback(io_service_t) -> HRESULT`](/documentation/ForceFeedback/FFIsForceFeedback(_:))

Used to determine if a particular device provided by HID Manager is a force feedback device.

[`func FFReleaseDevice(FFDeviceObjectReference!) -> HRESULT`](/documentation/ForceFeedback/FFReleaseDevice(_:))

Disposes of an API device object created with FFCreateDevice.

### Data Types

[`struct FFCAPABILITIES`](/documentation/ForceFeedback/FFCAPABILITIES)

Used by the FFDeviceGetForceFeedbackCapabilities method to retrieve device force-feedback capabilities.

[`struct FFCONDITION`](/documentation/ForceFeedback/FFCONDITION)

A structure containing type-specific information for certain effects.

[`struct FFCONSTANTFORCE`](/documentation/ForceFeedback/FFCONSTANTFORCE)

Contains type-specific information for the CONSTANTFORCE effect.

[`struct FFCUSTOMFORCE`](/documentation/ForceFeedback/FFCUSTOMFORCE)

Contains type-specific information for the CUSTOMFORCE effect.

[`struct FFEFFECT`](/documentation/ForceFeedback/FFEFFECT)

UsUsed by the FFDeviceCreateEffect method to initialize a new effect object. It is also used by the FFEffectSetParameters and FFEffectGetParameters functions.

[`struct FFEFFESCAPE`](/documentation/ForceFeedback/FFEFFESCAPE)

The FFEFFESCAPE structure passes hardware-specific data directly to the Force Feedback plugIn.

[`struct FFENVELOPE`](/documentation/ForceFeedback/FFENVELOPE)

Used by the FFEFFECT structure to specify the optional envelope parameters for an effect.

[`struct FFPERIODIC`](/documentation/ForceFeedback/FFPERIODIC)

A structure containing type-specific information for certain effects.

[`struct FFRAMPFORCE`](/documentation/ForceFeedback/FFRAMPFORCE)

Contains type-specific information for the RAMPFORCE effect.

### Constants



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)