---
title: "init(type:)"
framework: appkit
role: symbol
role_heading: Initializer
path: "appkit/nsevent/eventtypemask/init(type:)"
---

# init(type:)

Returns the event mask for the specified type.

## Declaration

```swift
init(type: NSEvent.EventType)
```

## Parameters

- `type`: The event type whose mask you want to get.

## Return Value

Return Value The event mask corresponding to the specified type. The returned mask is equivalent to the number 1 left-shifted by type bits.

## See Also

### Constants

- [NSEvent.EventTypeMask](appkit/nsevent/eventtypemask.md)
- [NSEvent.ButtonMask](appkit/nsevent/buttonmask-swift.struct.md)
- [NSEvent.ModifierFlags](appkit/nsevent/modifierflags-swift.struct.md)
- [NSEvent.Phase](appkit/nsevent/phase-swift.struct.md)
- [NSEvent.SwipeTrackingOptions](appkit/nsevent/swipetrackingoptions.md)
