---
title: worksWhenModal
framework: appkit
role: symbol
role_heading: Instance Property
path: appkit/nspanel/workswhenmodal
---

# worksWhenModal

A Boolean value that indicates whether the panel receives keyboard and mouse events even when some other window is being run modally.

## Declaration

```swift
var worksWhenModal: Bool { get set }
```

## Discussion

Discussion The value of this property is true when the panel receives keyboard and mouse events even when some other window is being run modally; when the value is false, the panel is prevented from receiving events while a modal loop or session is running. By default, the value of this property is false, indicating a panel’s ineligibility for events during a modal loop or session. See How Modal Windows Work for more information on modal windows and panels.

## See Also

### Related Documentation

- [runModalSession(_:)](appkit/nsapplication/runmodalsession(_:).md)
- [runModal(for:)](appkit/nsapplication/runmodal(for:).md)

### Configuring Panels

- [isFloatingPanel](appkit/nspanel/isfloatingpanel.md)
- [becomesKeyOnlyIfNeeded](appkit/nspanel/becomeskeyonlyifneeded.md)
