Skip to content

Commit 2c37327

Browse files
committed
Add NSEventMask::from_type
Available in the cococa crate, so we'll want it available as well.
1 parent f4e8bc1 commit 2c37327

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

crates/objc2/src/topics/about_generated/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
1414

1515
### Added
1616
* Added `IOKit` "serial" submodule.
17+
* Added various missing APIs.
1718

1819
## [0.3.1] - 2025-04-19
1920
[0.3.1]: https://github.com/madsmtm/objc2/compare/frameworks-0.3.0...frameworks-0.3.1
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
use crate::{NSEventMask, NSEventType};
2+
3+
impl NSEventMask {
4+
#[doc(alias = "NSEventMaskFromType")]
5+
pub fn from_type(ty: NSEventType) -> Self {
6+
Self(1 << ty.0)
7+
}
8+
}

framework-crates/objc2-app-kit/src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ pub(crate) const TARGET_ABI_USES_IOS_VALUES: bool =
4646

4747
#[cfg(feature = "NSApplication")]
4848
mod application;
49+
#[cfg(feature = "NSEvent")]
50+
mod event;
4951
mod generated;
5052
#[cfg(feature = "NSImage")]
5153
mod image;

0 commit comments

Comments
 (0)