---
title: "handlesGameControllerEvents(matching:)"
framework: swiftui
role: symbol
role_heading: Instance Method
path: "swiftui/view/handlesgamecontrollerevents(matching:)"
---

# handlesGameControllerEvents(matching:)

Specifies the game controllers events which should be delivered through the GameController framework when the view, or one of its descendants has focus.

## Declaration

```swift
nonisolated func handlesGameControllerEvents(matching types: GCUIEventTypes) -> some View

```

## Discussion

Discussion SpriteView(scene: MyGameScene()) .handlesGameControllerEvents(matching: .gamepad) .focused(true)
