<!--
{
  "availability" : [
    "FxPlug: 4.0.0 -",
    "macOS: 10.7.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "professional_video_applications",
  "identifier" : "/documentation/professional_video_applications/FxOnScreenControl_v4/hitTestOSC(atMousePositionX:mousePositionY:activePart:at:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Professional Video Applications"
    ],
    "preciseIdentifier" : "c:objc(pl)FxOnScreenControl_v4(im)hitTestOSCAtMousePositionX:mousePositionY:activePart:atTime:"
  },
  "title" : "hitTestOSC(atMousePositionX:mousePositionY:activePart:at:)"
}
-->

# hitTestOSC(atMousePositionX:mousePositionY:activePart:at:)

Figures out which part of the onscreen control was hit.

```
func hitTestOSC(atMousePositionX mousePositionX: Double, mousePositionY: Double, activePart: UnsafeMutablePointer<Int>!, at time: CMTime)
```

## Parameters

`mousePositionX`

The x position of the mouse

`mousePositionY`

The y position of the mouse

`activePart`

The part that was hit - set to `0` if no part was hit

`time`

The time at which we are checking for a hit

## Discussion

This method is called by the host to determine which part of your controls were hit by the mouse. Return a constant that represents a part number for your onscreen control in the activePart parameter. It will be sent to you in the `-draw`, `-mouse`, and `-key` methods so you can handle those events properly.

---

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)