<!--
{
  "availability" : [
    "macOS: 10.6.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSTextInputContext/handleEvent(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSTextInputContext(im)handleEvent:"
  },
  "title" : "handleEvent(_:)"
}
-->

# handleEvent(_:)

Tells the Cocoa text input system to handle mouse or key events.

```
func handleEvent(_ event: NSEvent) -> Bool
```

## Parameters

`event`

The event to handle.

## Return Value

<doc://com.apple.documentation/documentation/Swift/true> if the system consumed the event; otherwise <doc://com.apple.documentation/documentation/Swift/false>.

---

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)