---
title: "handleEvent(_:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nstextinputcontext/handleevent(_:)"
---

# handleEvent(_:)

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

## Declaration

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

## Parameters

- `event`: The event to handle.

## Return Value

Return Value true if the system consumed the event; otherwise false.

## See Also

### Handling Input Sources

- [discardMarkedText()](appkit/nstextinputcontext/discardmarkedtext().md)
- [invalidateCharacterCoordinates()](appkit/nstextinputcontext/invalidatecharactercoordinates().md)
- [keyboardInputSources](appkit/nstextinputcontext/keyboardinputsources.md)
- [selectedKeyboardInputSource](appkit/nstextinputcontext/selectedkeyboardinputsource.md)
- [localizedName(forInputSource:)](appkit/nstextinputcontext/localizedname(forinputsource:).md)
- [NSTextInputSourceIdentifier](appkit/nstextinputsourceidentifier.md)
