1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6#[cfg(feature = "objc2-core-foundation")]
7use objc2_core_foundation::*;
8#[cfg(feature = "objc2-core-graphics")]
9#[cfg(target_vendor = "apple")]
10use objc2_core_graphics::*;
11use objc2_foundation::*;
12
13use crate::*;
14
15#[repr(transparent)]
18#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
19pub struct NSEventType(pub NSUInteger);
20impl NSEventType {
21 #[doc(alias = "NSEventTypeLeftMouseDown")]
22 pub const LeftMouseDown: Self = Self(1);
23 #[doc(alias = "NSEventTypeLeftMouseUp")]
24 pub const LeftMouseUp: Self = Self(2);
25 #[doc(alias = "NSEventTypeRightMouseDown")]
26 pub const RightMouseDown: Self = Self(3);
27 #[doc(alias = "NSEventTypeRightMouseUp")]
28 pub const RightMouseUp: Self = Self(4);
29 #[doc(alias = "NSEventTypeMouseMoved")]
30 pub const MouseMoved: Self = Self(5);
31 #[doc(alias = "NSEventTypeLeftMouseDragged")]
32 pub const LeftMouseDragged: Self = Self(6);
33 #[doc(alias = "NSEventTypeRightMouseDragged")]
34 pub const RightMouseDragged: Self = Self(7);
35 #[doc(alias = "NSEventTypeMouseEntered")]
36 pub const MouseEntered: Self = Self(8);
37 #[doc(alias = "NSEventTypeMouseExited")]
38 pub const MouseExited: Self = Self(9);
39 #[doc(alias = "NSEventTypeKeyDown")]
40 pub const KeyDown: Self = Self(10);
41 #[doc(alias = "NSEventTypeKeyUp")]
42 pub const KeyUp: Self = Self(11);
43 #[doc(alias = "NSEventTypeFlagsChanged")]
44 pub const FlagsChanged: Self = Self(12);
45 #[doc(alias = "NSEventTypeAppKitDefined")]
46 pub const AppKitDefined: Self = Self(13);
47 #[doc(alias = "NSEventTypeSystemDefined")]
48 pub const SystemDefined: Self = Self(14);
49 #[doc(alias = "NSEventTypeApplicationDefined")]
50 pub const ApplicationDefined: Self = Self(15);
51 #[doc(alias = "NSEventTypePeriodic")]
52 pub const Periodic: Self = Self(16);
53 #[doc(alias = "NSEventTypeCursorUpdate")]
54 pub const CursorUpdate: Self = Self(17);
55 #[doc(alias = "NSEventTypeScrollWheel")]
56 pub const ScrollWheel: Self = Self(22);
57 #[doc(alias = "NSEventTypeTabletPoint")]
58 pub const TabletPoint: Self = Self(23);
59 #[doc(alias = "NSEventTypeTabletProximity")]
60 pub const TabletProximity: Self = Self(24);
61 #[doc(alias = "NSEventTypeOtherMouseDown")]
62 pub const OtherMouseDown: Self = Self(25);
63 #[doc(alias = "NSEventTypeOtherMouseUp")]
64 pub const OtherMouseUp: Self = Self(26);
65 #[doc(alias = "NSEventTypeOtherMouseDragged")]
66 pub const OtherMouseDragged: Self = Self(27);
67 #[doc(alias = "NSEventTypeGesture")]
68 pub const Gesture: Self = Self(29);
69 #[doc(alias = "NSEventTypeMagnify")]
70 pub const Magnify: Self = Self(30);
71 #[doc(alias = "NSEventTypeSwipe")]
72 pub const Swipe: Self = Self(31);
73 #[doc(alias = "NSEventTypeRotate")]
74 pub const Rotate: Self = Self(18);
75 #[doc(alias = "NSEventTypeBeginGesture")]
76 pub const BeginGesture: Self = Self(19);
77 #[doc(alias = "NSEventTypeEndGesture")]
78 pub const EndGesture: Self = Self(20);
79 #[doc(alias = "NSEventTypeSmartMagnify")]
80 pub const SmartMagnify: Self = Self(32);
81 #[doc(alias = "NSEventTypeQuickLook")]
82 pub const QuickLook: Self = Self(33);
83 #[doc(alias = "NSEventTypePressure")]
84 pub const Pressure: Self = Self(34);
85 #[doc(alias = "NSEventTypeDirectTouch")]
86 pub const DirectTouch: Self = Self(37);
87 #[doc(alias = "NSEventTypeChangeMode")]
88 pub const ChangeMode: Self = Self(38);
89}
90
91unsafe impl Encode for NSEventType {
92 const ENCODING: Encoding = NSUInteger::ENCODING;
93}
94
95unsafe impl RefEncode for NSEventType {
96 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
97}
98
99pub static NSLeftMouseDown: NSEventType = NSEventType(NSEventType::LeftMouseDown.0);
101
102pub static NSLeftMouseUp: NSEventType = NSEventType(NSEventType::LeftMouseUp.0);
104
105pub static NSRightMouseDown: NSEventType = NSEventType(NSEventType::RightMouseDown.0);
107
108pub static NSRightMouseUp: NSEventType = NSEventType(NSEventType::RightMouseUp.0);
110
111pub static NSMouseMoved: NSEventType = NSEventType(NSEventType::MouseMoved.0);
113
114pub static NSLeftMouseDragged: NSEventType = NSEventType(NSEventType::LeftMouseDragged.0);
116
117pub static NSRightMouseDragged: NSEventType = NSEventType(NSEventType::RightMouseDragged.0);
119
120pub static NSMouseEntered: NSEventType = NSEventType(NSEventType::MouseEntered.0);
122
123pub static NSMouseExited: NSEventType = NSEventType(NSEventType::MouseExited.0);
125
126pub static NSKeyDown: NSEventType = NSEventType(NSEventType::KeyDown.0);
128
129pub static NSKeyUp: NSEventType = NSEventType(NSEventType::KeyUp.0);
131
132pub static NSFlagsChanged: NSEventType = NSEventType(NSEventType::FlagsChanged.0);
134
135pub static NSAppKitDefined: NSEventType = NSEventType(NSEventType::AppKitDefined.0);
137
138pub static NSSystemDefined: NSEventType = NSEventType(NSEventType::SystemDefined.0);
140
141pub static NSApplicationDefined: NSEventType = NSEventType(NSEventType::ApplicationDefined.0);
143
144pub static NSPeriodic: NSEventType = NSEventType(NSEventType::Periodic.0);
146
147pub static NSCursorUpdate: NSEventType = NSEventType(NSEventType::CursorUpdate.0);
149
150pub static NSScrollWheel: NSEventType = NSEventType(NSEventType::ScrollWheel.0);
152
153pub static NSTabletPoint: NSEventType = NSEventType(NSEventType::TabletPoint.0);
155
156pub static NSTabletProximity: NSEventType = NSEventType(NSEventType::TabletProximity.0);
158
159pub static NSOtherMouseDown: NSEventType = NSEventType(NSEventType::OtherMouseDown.0);
161
162pub static NSOtherMouseUp: NSEventType = NSEventType(NSEventType::OtherMouseUp.0);
164
165pub static NSOtherMouseDragged: NSEventType = NSEventType(NSEventType::OtherMouseDragged.0);
167
168#[repr(transparent)]
171#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
172pub struct NSEventMask(pub c_ulonglong);
173bitflags::bitflags! {
174 impl NSEventMask: c_ulonglong {
175 #[doc(alias = "NSEventMaskLeftMouseDown")]
176 const LeftMouseDown = 1<<NSEventType::LeftMouseDown.0;
177 #[doc(alias = "NSEventMaskLeftMouseUp")]
178 const LeftMouseUp = 1<<NSEventType::LeftMouseUp.0;
179 #[doc(alias = "NSEventMaskRightMouseDown")]
180 const RightMouseDown = 1<<NSEventType::RightMouseDown.0;
181 #[doc(alias = "NSEventMaskRightMouseUp")]
182 const RightMouseUp = 1<<NSEventType::RightMouseUp.0;
183 #[doc(alias = "NSEventMaskMouseMoved")]
184 const MouseMoved = 1<<NSEventType::MouseMoved.0;
185 #[doc(alias = "NSEventMaskLeftMouseDragged")]
186 const LeftMouseDragged = 1<<NSEventType::LeftMouseDragged.0;
187 #[doc(alias = "NSEventMaskRightMouseDragged")]
188 const RightMouseDragged = 1<<NSEventType::RightMouseDragged.0;
189 #[doc(alias = "NSEventMaskMouseEntered")]
190 const MouseEntered = 1<<NSEventType::MouseEntered.0;
191 #[doc(alias = "NSEventMaskMouseExited")]
192 const MouseExited = 1<<NSEventType::MouseExited.0;
193 #[doc(alias = "NSEventMaskKeyDown")]
194 const KeyDown = 1<<NSEventType::KeyDown.0;
195 #[doc(alias = "NSEventMaskKeyUp")]
196 const KeyUp = 1<<NSEventType::KeyUp.0;
197 #[doc(alias = "NSEventMaskFlagsChanged")]
198 const FlagsChanged = 1<<NSEventType::FlagsChanged.0;
199 #[doc(alias = "NSEventMaskAppKitDefined")]
200 const AppKitDefined = 1<<NSEventType::AppKitDefined.0;
201 #[doc(alias = "NSEventMaskSystemDefined")]
202 const SystemDefined = 1<<NSEventType::SystemDefined.0;
203 #[doc(alias = "NSEventMaskApplicationDefined")]
204 const ApplicationDefined = 1<<NSEventType::ApplicationDefined.0;
205 #[doc(alias = "NSEventMaskPeriodic")]
206 const Periodic = 1<<NSEventType::Periodic.0;
207 #[doc(alias = "NSEventMaskCursorUpdate")]
208 const CursorUpdate = 1<<NSEventType::CursorUpdate.0;
209 #[doc(alias = "NSEventMaskScrollWheel")]
210 const ScrollWheel = 1<<NSEventType::ScrollWheel.0;
211 #[doc(alias = "NSEventMaskTabletPoint")]
212 const TabletPoint = 1<<NSEventType::TabletPoint.0;
213 #[doc(alias = "NSEventMaskTabletProximity")]
214 const TabletProximity = 1<<NSEventType::TabletProximity.0;
215 #[doc(alias = "NSEventMaskOtherMouseDown")]
216 const OtherMouseDown = 1<<NSEventType::OtherMouseDown.0;
217 #[doc(alias = "NSEventMaskOtherMouseUp")]
218 const OtherMouseUp = 1<<NSEventType::OtherMouseUp.0;
219 #[doc(alias = "NSEventMaskOtherMouseDragged")]
220 const OtherMouseDragged = 1<<NSEventType::OtherMouseDragged.0;
221 #[doc(alias = "NSEventMaskGesture")]
222 const Gesture = 1<<NSEventType::Gesture.0;
223 #[doc(alias = "NSEventMaskMagnify")]
224 const Magnify = 1<<NSEventType::Magnify.0;
225 #[doc(alias = "NSEventMaskSwipe")]
226 const Swipe = 1<<NSEventType::Swipe.0;
227 #[doc(alias = "NSEventMaskRotate")]
228 const Rotate = 1<<NSEventType::Rotate.0;
229 #[doc(alias = "NSEventMaskBeginGesture")]
230 const BeginGesture = 1<<NSEventType::BeginGesture.0;
231 #[doc(alias = "NSEventMaskEndGesture")]
232 const EndGesture = 1<<NSEventType::EndGesture.0;
233 #[doc(alias = "NSEventMaskSmartMagnify")]
234 const SmartMagnify = 1<<NSEventType::SmartMagnify.0;
235 #[doc(alias = "NSEventMaskPressure")]
236 const Pressure = 1<<NSEventType::Pressure.0;
237 #[doc(alias = "NSEventMaskDirectTouch")]
238 const DirectTouch = 1<<NSEventType::DirectTouch.0;
239 #[doc(alias = "NSEventMaskChangeMode")]
240 const ChangeMode = 1<<NSEventType::ChangeMode.0;
241 #[doc(alias = "NSEventMaskAny")]
242 const Any = NSUIntegerMax as _;
243 }
244}
245
246unsafe impl Encode for NSEventMask {
247 const ENCODING: Encoding = c_ulonglong::ENCODING;
248}
249
250unsafe impl RefEncode for NSEventMask {
251 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
252}
253
254pub static NSLeftMouseDownMask: NSEventMask = NSEventMask(NSEventMask::LeftMouseDown.0);
256
257pub static NSLeftMouseUpMask: NSEventMask = NSEventMask(NSEventMask::LeftMouseUp.0);
259
260pub static NSRightMouseDownMask: NSEventMask = NSEventMask(NSEventMask::RightMouseDown.0);
262
263pub static NSRightMouseUpMask: NSEventMask = NSEventMask(NSEventMask::RightMouseUp.0);
265
266pub static NSMouseMovedMask: NSEventMask = NSEventMask(NSEventMask::MouseMoved.0);
268
269pub static NSLeftMouseDraggedMask: NSEventMask = NSEventMask(NSEventMask::LeftMouseDragged.0);
271
272pub static NSRightMouseDraggedMask: NSEventMask = NSEventMask(NSEventMask::RightMouseDragged.0);
274
275pub static NSMouseEnteredMask: NSEventMask = NSEventMask(NSEventMask::MouseEntered.0);
277
278pub static NSMouseExitedMask: NSEventMask = NSEventMask(NSEventMask::MouseExited.0);
280
281pub static NSKeyDownMask: NSEventMask = NSEventMask(NSEventMask::KeyDown.0);
283
284pub static NSKeyUpMask: NSEventMask = NSEventMask(NSEventMask::KeyUp.0);
286
287pub static NSFlagsChangedMask: NSEventMask = NSEventMask(NSEventMask::FlagsChanged.0);
289
290pub static NSAppKitDefinedMask: NSEventMask = NSEventMask(NSEventMask::AppKitDefined.0);
292
293pub static NSSystemDefinedMask: NSEventMask = NSEventMask(NSEventMask::SystemDefined.0);
295
296pub static NSApplicationDefinedMask: NSEventMask = NSEventMask(NSEventMask::ApplicationDefined.0);
298
299pub static NSPeriodicMask: NSEventMask = NSEventMask(NSEventMask::Periodic.0);
301
302pub static NSCursorUpdateMask: NSEventMask = NSEventMask(NSEventMask::CursorUpdate.0);
304
305pub static NSScrollWheelMask: NSEventMask = NSEventMask(NSEventMask::ScrollWheel.0);
307
308pub static NSTabletPointMask: NSEventMask = NSEventMask(NSEventMask::TabletPoint.0);
310
311pub static NSTabletProximityMask: NSEventMask = NSEventMask(NSEventMask::TabletProximity.0);
313
314pub static NSOtherMouseDownMask: NSEventMask = NSEventMask(NSEventMask::OtherMouseDown.0);
316
317pub static NSOtherMouseUpMask: NSEventMask = NSEventMask(NSEventMask::OtherMouseUp.0);
319
320pub static NSOtherMouseDraggedMask: NSEventMask = NSEventMask(NSEventMask::OtherMouseDragged.0);
322
323pub static NSAnyEventMask: NSEventMask = NSEventMask(NSUIntegerMax as _);
325
326impl NSEventMask {
327 }
329
330#[repr(transparent)]
333#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
334pub struct NSEventModifierFlags(pub NSUInteger);
335bitflags::bitflags! {
336 impl NSEventModifierFlags: NSUInteger {
337 #[doc(alias = "NSEventModifierFlagCapsLock")]
338 const CapsLock = 1<<16;
339 #[doc(alias = "NSEventModifierFlagShift")]
340 const Shift = 1<<17;
341 #[doc(alias = "NSEventModifierFlagControl")]
342 const Control = 1<<18;
343 #[doc(alias = "NSEventModifierFlagOption")]
344 const Option = 1<<19;
345 #[doc(alias = "NSEventModifierFlagCommand")]
346 const Command = 1<<20;
347 #[doc(alias = "NSEventModifierFlagNumericPad")]
348 const NumericPad = 1<<21;
349 #[doc(alias = "NSEventModifierFlagHelp")]
350 const Help = 1<<22;
351 #[doc(alias = "NSEventModifierFlagFunction")]
352 const Function = 1<<23;
353 #[doc(alias = "NSEventModifierFlagDeviceIndependentFlagsMask")]
354 const DeviceIndependentFlagsMask = 0xffff0000;
355 }
356}
357
358unsafe impl Encode for NSEventModifierFlags {
359 const ENCODING: Encoding = NSUInteger::ENCODING;
360}
361
362unsafe impl RefEncode for NSEventModifierFlags {
363 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
364}
365
366pub static NSAlphaShiftKeyMask: NSEventModifierFlags =
368 NSEventModifierFlags(NSEventModifierFlags::CapsLock.0);
369
370pub static NSShiftKeyMask: NSEventModifierFlags =
372 NSEventModifierFlags(NSEventModifierFlags::Shift.0);
373
374pub static NSControlKeyMask: NSEventModifierFlags =
376 NSEventModifierFlags(NSEventModifierFlags::Control.0);
377
378pub static NSAlternateKeyMask: NSEventModifierFlags =
380 NSEventModifierFlags(NSEventModifierFlags::Option.0);
381
382pub static NSCommandKeyMask: NSEventModifierFlags =
384 NSEventModifierFlags(NSEventModifierFlags::Command.0);
385
386pub static NSNumericPadKeyMask: NSEventModifierFlags =
388 NSEventModifierFlags(NSEventModifierFlags::NumericPad.0);
389
390pub static NSHelpKeyMask: NSEventModifierFlags = NSEventModifierFlags(NSEventModifierFlags::Help.0);
392
393pub static NSFunctionKeyMask: NSEventModifierFlags =
395 NSEventModifierFlags(NSEventModifierFlags::Function.0);
396
397pub static NSDeviceIndependentModifierFlagsMask: NSEventModifierFlags =
399 NSEventModifierFlags(NSEventModifierFlags::DeviceIndependentFlagsMask.0);
400
401#[repr(transparent)]
404#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
405pub struct NSPointingDeviceType(pub NSUInteger);
406impl NSPointingDeviceType {
407 #[doc(alias = "NSPointingDeviceTypeUnknown")]
408 pub const Unknown: Self = Self(0);
409 #[doc(alias = "NSPointingDeviceTypePen")]
410 pub const Pen: Self = Self(1);
411 #[doc(alias = "NSPointingDeviceTypeCursor")]
412 pub const Cursor: Self = Self(2);
413 #[doc(alias = "NSPointingDeviceTypeEraser")]
414 pub const Eraser: Self = Self(3);
415}
416
417unsafe impl Encode for NSPointingDeviceType {
418 const ENCODING: Encoding = NSUInteger::ENCODING;
419}
420
421unsafe impl RefEncode for NSPointingDeviceType {
422 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
423}
424
425pub static NSUnknownPointingDevice: NSPointingDeviceType =
427 NSPointingDeviceType(NSPointingDeviceType::Unknown.0);
428
429pub static NSPenPointingDevice: NSPointingDeviceType =
431 NSPointingDeviceType(NSPointingDeviceType::Pen.0);
432
433pub static NSCursorPointingDevice: NSPointingDeviceType =
435 NSPointingDeviceType(NSPointingDeviceType::Cursor.0);
436
437pub static NSEraserPointingDevice: NSPointingDeviceType =
439 NSPointingDeviceType(NSPointingDeviceType::Eraser.0);
440
441#[repr(transparent)]
444#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
445pub struct NSEventButtonMask(pub NSUInteger);
446bitflags::bitflags! {
447 impl NSEventButtonMask: NSUInteger {
448 #[doc(alias = "NSEventButtonMaskPenTip")]
449 const PenTip = 1;
450 #[doc(alias = "NSEventButtonMaskPenLowerSide")]
451 const PenLowerSide = 2;
452 #[doc(alias = "NSEventButtonMaskPenUpperSide")]
453 const PenUpperSide = 4;
454 }
455}
456
457unsafe impl Encode for NSEventButtonMask {
458 const ENCODING: Encoding = NSUInteger::ENCODING;
459}
460
461unsafe impl RefEncode for NSEventButtonMask {
462 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
463}
464
465pub static NSPenTipMask: NSEventButtonMask = NSEventButtonMask(NSEventButtonMask::PenTip.0);
467
468pub static NSPenLowerSideMask: NSEventButtonMask =
470 NSEventButtonMask(NSEventButtonMask::PenLowerSide.0);
471
472pub static NSPenUpperSideMask: NSEventButtonMask =
474 NSEventButtonMask(NSEventButtonMask::PenUpperSide.0);
475
476#[repr(transparent)]
479#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
480pub struct NSEventPhase(pub NSUInteger);
481bitflags::bitflags! {
482 impl NSEventPhase: NSUInteger {
483 #[doc(alias = "NSEventPhaseNone")]
484 const None = 0;
485 #[doc(alias = "NSEventPhaseBegan")]
486 const Began = 0x1<<0;
487 #[doc(alias = "NSEventPhaseStationary")]
488 const Stationary = 0x1<<1;
489 #[doc(alias = "NSEventPhaseChanged")]
490 const Changed = 0x1<<2;
491 #[doc(alias = "NSEventPhaseEnded")]
492 const Ended = 0x1<<3;
493 #[doc(alias = "NSEventPhaseCancelled")]
494 const Cancelled = 0x1<<4;
495 #[doc(alias = "NSEventPhaseMayBegin")]
496 const MayBegin = 0x1<<5;
497 }
498}
499
500unsafe impl Encode for NSEventPhase {
501 const ENCODING: Encoding = NSUInteger::ENCODING;
502}
503
504unsafe impl RefEncode for NSEventPhase {
505 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
506}
507
508#[repr(transparent)]
511#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
512pub struct NSEventGestureAxis(pub NSInteger);
513impl NSEventGestureAxis {
514 #[doc(alias = "NSEventGestureAxisNone")]
515 pub const None: Self = Self(0);
516 #[doc(alias = "NSEventGestureAxisHorizontal")]
517 pub const Horizontal: Self = Self(1);
518 #[doc(alias = "NSEventGestureAxisVertical")]
519 pub const Vertical: Self = Self(2);
520}
521
522unsafe impl Encode for NSEventGestureAxis {
523 const ENCODING: Encoding = NSInteger::ENCODING;
524}
525
526unsafe impl RefEncode for NSEventGestureAxis {
527 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
528}
529
530#[repr(transparent)]
533#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
534pub struct NSEventSwipeTrackingOptions(pub NSUInteger);
535bitflags::bitflags! {
536 impl NSEventSwipeTrackingOptions: NSUInteger {
537 #[doc(alias = "NSEventSwipeTrackingLockDirection")]
538 const LockDirection = 0x1<<0;
539 #[doc(alias = "NSEventSwipeTrackingClampGestureAmount")]
540 const ClampGestureAmount = 0x1<<1;
541 }
542}
543
544unsafe impl Encode for NSEventSwipeTrackingOptions {
545 const ENCODING: Encoding = NSUInteger::ENCODING;
546}
547
548unsafe impl RefEncode for NSEventSwipeTrackingOptions {
549 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
550}
551
552#[repr(transparent)]
555#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
556pub struct NSEventSubtype(pub c_short);
557impl NSEventSubtype {
558 #[doc(alias = "NSEventSubtypeWindowExposed")]
559 pub const WindowExposed: Self = Self(0);
560 #[doc(alias = "NSEventSubtypeApplicationActivated")]
561 pub const ApplicationActivated: Self = Self(1);
562 #[doc(alias = "NSEventSubtypeApplicationDeactivated")]
563 pub const ApplicationDeactivated: Self = Self(2);
564 #[doc(alias = "NSEventSubtypeWindowMoved")]
565 pub const WindowMoved: Self = Self(4);
566 #[doc(alias = "NSEventSubtypeScreenChanged")]
567 pub const ScreenChanged: Self = Self(8);
568 #[doc(alias = "NSEventSubtypePowerOff")]
569 pub const PowerOff: Self = Self(1);
570 #[doc(alias = "NSEventSubtypeMouseEvent")]
571 pub const MouseEvent: Self = Self(0);
572 #[doc(alias = "NSEventSubtypeTabletPoint")]
573 pub const TabletPoint: Self = Self(1);
574 #[doc(alias = "NSEventSubtypeTabletProximity")]
575 pub const TabletProximity: Self = Self(2);
576 #[doc(alias = "NSEventSubtypeTouch")]
577 pub const Touch: Self = Self(3);
578}
579
580unsafe impl Encode for NSEventSubtype {
581 const ENCODING: Encoding = c_short::ENCODING;
582}
583
584unsafe impl RefEncode for NSEventSubtype {
585 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
586}
587
588pub static NSWindowExposedEventType: NSEventSubtype =
590 NSEventSubtype(NSEventSubtype::WindowExposed.0);
591
592pub static NSApplicationActivatedEventType: NSEventSubtype =
594 NSEventSubtype(NSEventSubtype::ApplicationActivated.0);
595
596pub static NSApplicationDeactivatedEventType: NSEventSubtype =
598 NSEventSubtype(NSEventSubtype::ApplicationDeactivated.0);
599
600pub static NSWindowMovedEventType: NSEventSubtype = NSEventSubtype(NSEventSubtype::WindowMoved.0);
602
603pub static NSScreenChangedEventType: NSEventSubtype =
605 NSEventSubtype(NSEventSubtype::ScreenChanged.0);
606
607pub static NSAWTEventType: NSEventSubtype = NSEventSubtype(16);
609
610pub static NSPowerOffEventType: NSEventSubtype = NSEventSubtype(NSEventSubtype::PowerOff.0);
612
613pub static NSMouseEventSubtype: NSEventSubtype = NSEventSubtype(NSEventSubtype::MouseEvent.0);
615
616pub static NSTabletPointEventSubtype: NSEventSubtype =
618 NSEventSubtype(NSEventSubtype::TabletPoint.0);
619
620pub static NSTabletProximityEventSubtype: NSEventSubtype =
622 NSEventSubtype(NSEventSubtype::TabletProximity.0);
623
624pub static NSTouchEventSubtype: NSEventSubtype = NSEventSubtype(NSEventSubtype::Touch.0);
626
627#[repr(transparent)]
630#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
631pub struct NSPressureBehavior(pub NSInteger);
632impl NSPressureBehavior {
633 #[doc(alias = "NSPressureBehaviorUnknown")]
634 pub const Unknown: Self = Self(-1);
635 #[doc(alias = "NSPressureBehaviorPrimaryDefault")]
636 pub const PrimaryDefault: Self = Self(0);
637 #[doc(alias = "NSPressureBehaviorPrimaryClick")]
638 pub const PrimaryClick: Self = Self(1);
639 #[doc(alias = "NSPressureBehaviorPrimaryGeneric")]
640 pub const PrimaryGeneric: Self = Self(2);
641 #[doc(alias = "NSPressureBehaviorPrimaryAccelerator")]
642 pub const PrimaryAccelerator: Self = Self(3);
643 #[doc(alias = "NSPressureBehaviorPrimaryDeepClick")]
644 pub const PrimaryDeepClick: Self = Self(5);
645 #[doc(alias = "NSPressureBehaviorPrimaryDeepDrag")]
646 pub const PrimaryDeepDrag: Self = Self(6);
647}
648
649unsafe impl Encode for NSPressureBehavior {
650 const ENCODING: Encoding = NSInteger::ENCODING;
651}
652
653unsafe impl RefEncode for NSPressureBehavior {
654 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
655}
656
657extern_class!(
658 #[unsafe(super(NSObject))]
660 #[derive(Debug, PartialEq, Eq, Hash)]
661 pub struct NSEvent;
662);
663
664extern_conformance!(
665 unsafe impl NSCoding for NSEvent {}
666);
667
668extern_conformance!(
669 unsafe impl NSCopying for NSEvent {}
670);
671
672unsafe impl CopyingHelper for NSEvent {
673 type Result = Self;
674}
675
676extern_conformance!(
677 unsafe impl NSObjectProtocol for NSEvent {}
678);
679
680impl NSEvent {
681 extern_methods!(
682 #[unsafe(method(type))]
683 #[unsafe(method_family = none)]
684 pub unsafe fn r#type(&self) -> NSEventType;
685
686 #[unsafe(method(modifierFlags))]
687 #[unsafe(method_family = none)]
688 pub unsafe fn modifierFlags(&self) -> NSEventModifierFlags;
689
690 #[unsafe(method(timestamp))]
691 #[unsafe(method_family = none)]
692 pub unsafe fn timestamp(&self) -> NSTimeInterval;
693
694 #[cfg(all(feature = "NSResponder", feature = "NSWindow"))]
695 #[unsafe(method(window))]
696 #[unsafe(method_family = none)]
697 pub unsafe fn window(&self, mtm: MainThreadMarker) -> Option<Retained<NSWindow>>;
698
699 #[unsafe(method(windowNumber))]
700 #[unsafe(method_family = none)]
701 pub unsafe fn windowNumber(&self) -> NSInteger;
702
703 #[cfg(feature = "NSGraphicsContext")]
704 #[deprecated = "This method always returns nil. If you need access to the current drawing context, use [NSGraphicsContext currentContext] inside of a draw operation."]
705 #[unsafe(method(context))]
706 #[unsafe(method_family = none)]
707 pub unsafe fn context(&self) -> Option<Retained<NSGraphicsContext>>;
708
709 #[unsafe(method(clickCount))]
710 #[unsafe(method_family = none)]
711 pub unsafe fn clickCount(&self) -> NSInteger;
712
713 #[unsafe(method(buttonNumber))]
714 #[unsafe(method_family = none)]
715 pub unsafe fn buttonNumber(&self) -> NSInteger;
716
717 #[unsafe(method(eventNumber))]
718 #[unsafe(method_family = none)]
719 pub unsafe fn eventNumber(&self) -> NSInteger;
720
721 #[unsafe(method(pressure))]
722 #[unsafe(method_family = none)]
723 pub unsafe fn pressure(&self) -> c_float;
724
725 #[unsafe(method(locationInWindow))]
726 #[unsafe(method_family = none)]
727 pub unsafe fn locationInWindow(&self) -> NSPoint;
728
729 #[cfg(feature = "objc2-core-foundation")]
730 #[unsafe(method(deltaX))]
731 #[unsafe(method_family = none)]
732 pub unsafe fn deltaX(&self) -> CGFloat;
733
734 #[cfg(feature = "objc2-core-foundation")]
735 #[unsafe(method(deltaY))]
736 #[unsafe(method_family = none)]
737 pub unsafe fn deltaY(&self) -> CGFloat;
738
739 #[cfg(feature = "objc2-core-foundation")]
740 #[unsafe(method(deltaZ))]
741 #[unsafe(method_family = none)]
742 pub unsafe fn deltaZ(&self) -> CGFloat;
743
744 #[unsafe(method(hasPreciseScrollingDeltas))]
745 #[unsafe(method_family = none)]
746 pub unsafe fn hasPreciseScrollingDeltas(&self) -> bool;
747
748 #[cfg(feature = "objc2-core-foundation")]
749 #[unsafe(method(scrollingDeltaX))]
750 #[unsafe(method_family = none)]
751 pub unsafe fn scrollingDeltaX(&self) -> CGFloat;
752
753 #[cfg(feature = "objc2-core-foundation")]
754 #[unsafe(method(scrollingDeltaY))]
755 #[unsafe(method_family = none)]
756 pub unsafe fn scrollingDeltaY(&self) -> CGFloat;
757
758 #[unsafe(method(momentumPhase))]
759 #[unsafe(method_family = none)]
760 pub unsafe fn momentumPhase(&self) -> NSEventPhase;
761
762 #[unsafe(method(isDirectionInvertedFromDevice))]
763 #[unsafe(method_family = none)]
764 pub unsafe fn isDirectionInvertedFromDevice(&self) -> bool;
765
766 #[unsafe(method(characters))]
767 #[unsafe(method_family = none)]
768 pub unsafe fn characters(&self) -> Option<Retained<NSString>>;
769
770 #[unsafe(method(charactersIgnoringModifiers))]
771 #[unsafe(method_family = none)]
772 pub unsafe fn charactersIgnoringModifiers(&self) -> Option<Retained<NSString>>;
773
774 #[unsafe(method(charactersByApplyingModifiers:))]
775 #[unsafe(method_family = none)]
776 pub unsafe fn charactersByApplyingModifiers(
777 &self,
778 modifiers: NSEventModifierFlags,
779 ) -> Option<Retained<NSString>>;
780
781 #[unsafe(method(isARepeat))]
782 #[unsafe(method_family = none)]
783 pub unsafe fn isARepeat(&self) -> bool;
784
785 #[unsafe(method(keyCode))]
786 #[unsafe(method_family = none)]
787 pub unsafe fn keyCode(&self) -> c_ushort;
788
789 #[unsafe(method(trackingNumber))]
790 #[unsafe(method_family = none)]
791 pub unsafe fn trackingNumber(&self) -> NSInteger;
792
793 #[unsafe(method(userData))]
794 #[unsafe(method_family = none)]
795 pub unsafe fn userData(&self) -> *mut c_void;
796
797 #[cfg(feature = "NSTrackingArea")]
798 #[unsafe(method(trackingArea))]
799 #[unsafe(method_family = none)]
800 pub unsafe fn trackingArea(&self) -> Option<Retained<NSTrackingArea>>;
801
802 #[unsafe(method(subtype))]
803 #[unsafe(method_family = none)]
804 pub unsafe fn subtype(&self) -> NSEventSubtype;
805
806 #[unsafe(method(data1))]
807 #[unsafe(method_family = none)]
808 pub unsafe fn data1(&self) -> NSInteger;
809
810 #[unsafe(method(data2))]
811 #[unsafe(method_family = none)]
812 pub unsafe fn data2(&self) -> NSInteger;
813
814 #[unsafe(method(eventRef))]
815 #[unsafe(method_family = none)]
816 pub unsafe fn eventRef(&self) -> *const c_void;
817
818 #[unsafe(method(eventWithEventRef:))]
819 #[unsafe(method_family = none)]
820 pub unsafe fn eventWithEventRef(event_ref: NonNull<c_void>) -> Option<Retained<NSEvent>>;
821
822 #[cfg(feature = "objc2-core-graphics")]
823 #[cfg(target_vendor = "apple")]
824 #[unsafe(method(CGEvent))]
825 #[unsafe(method_family = none)]
826 pub unsafe fn CGEvent(&self) -> Option<Retained<CGEvent>>;
827
828 #[cfg(feature = "objc2-core-graphics")]
829 #[cfg(target_vendor = "apple")]
830 #[unsafe(method(eventWithCGEvent:))]
831 #[unsafe(method_family = none)]
832 pub unsafe fn eventWithCGEvent(cg_event: &CGEvent) -> Option<Retained<NSEvent>>;
833
834 #[unsafe(method(isMouseCoalescingEnabled))]
835 #[unsafe(method_family = none)]
836 pub unsafe fn isMouseCoalescingEnabled() -> bool;
837
838 #[unsafe(method(setMouseCoalescingEnabled:))]
840 #[unsafe(method_family = none)]
841 pub unsafe fn setMouseCoalescingEnabled(mouse_coalescing_enabled: bool);
842
843 #[cfg(feature = "objc2-core-foundation")]
844 #[unsafe(method(magnification))]
845 #[unsafe(method_family = none)]
846 pub unsafe fn magnification(&self) -> CGFloat;
847
848 #[unsafe(method(deviceID))]
849 #[unsafe(method_family = none)]
850 pub unsafe fn deviceID(&self) -> NSUInteger;
851
852 #[unsafe(method(rotation))]
853 #[unsafe(method_family = none)]
854 pub unsafe fn rotation(&self) -> c_float;
855
856 #[unsafe(method(absoluteX))]
857 #[unsafe(method_family = none)]
858 pub unsafe fn absoluteX(&self) -> NSInteger;
859
860 #[unsafe(method(absoluteY))]
861 #[unsafe(method_family = none)]
862 pub unsafe fn absoluteY(&self) -> NSInteger;
863
864 #[unsafe(method(absoluteZ))]
865 #[unsafe(method_family = none)]
866 pub unsafe fn absoluteZ(&self) -> NSInteger;
867
868 #[unsafe(method(buttonMask))]
869 #[unsafe(method_family = none)]
870 pub unsafe fn buttonMask(&self) -> NSEventButtonMask;
871
872 #[unsafe(method(tilt))]
873 #[unsafe(method_family = none)]
874 pub unsafe fn tilt(&self) -> NSPoint;
875
876 #[unsafe(method(tangentialPressure))]
877 #[unsafe(method_family = none)]
878 pub unsafe fn tangentialPressure(&self) -> c_float;
879
880 #[unsafe(method(vendorDefined))]
881 #[unsafe(method_family = none)]
882 pub unsafe fn vendorDefined(&self) -> Retained<AnyObject>;
883
884 #[unsafe(method(vendorID))]
885 #[unsafe(method_family = none)]
886 pub unsafe fn vendorID(&self) -> NSUInteger;
887
888 #[unsafe(method(tabletID))]
889 #[unsafe(method_family = none)]
890 pub unsafe fn tabletID(&self) -> NSUInteger;
891
892 #[unsafe(method(pointingDeviceID))]
893 #[unsafe(method_family = none)]
894 pub unsafe fn pointingDeviceID(&self) -> NSUInteger;
895
896 #[unsafe(method(systemTabletID))]
897 #[unsafe(method_family = none)]
898 pub unsafe fn systemTabletID(&self) -> NSUInteger;
899
900 #[unsafe(method(vendorPointingDeviceType))]
901 #[unsafe(method_family = none)]
902 pub unsafe fn vendorPointingDeviceType(&self) -> NSUInteger;
903
904 #[unsafe(method(pointingDeviceSerialNumber))]
905 #[unsafe(method_family = none)]
906 pub unsafe fn pointingDeviceSerialNumber(&self) -> NSUInteger;
907
908 #[unsafe(method(uniqueID))]
909 #[unsafe(method_family = none)]
910 pub unsafe fn uniqueID(&self) -> c_ulonglong;
911
912 #[unsafe(method(capabilityMask))]
913 #[unsafe(method_family = none)]
914 pub unsafe fn capabilityMask(&self) -> NSUInteger;
915
916 #[unsafe(method(pointingDeviceType))]
917 #[unsafe(method_family = none)]
918 pub unsafe fn pointingDeviceType(&self) -> NSPointingDeviceType;
919
920 #[unsafe(method(isEnteringProximity))]
921 #[unsafe(method_family = none)]
922 pub unsafe fn isEnteringProximity(&self) -> bool;
923
924 #[cfg(all(feature = "NSResponder", feature = "NSTouch", feature = "NSView"))]
925 #[unsafe(method(touchesMatchingPhase:inView:))]
926 #[unsafe(method_family = none)]
927 pub unsafe fn touchesMatchingPhase_inView(
928 &self,
929 phase: NSTouchPhase,
930 view: Option<&NSView>,
931 ) -> Retained<NSSet<NSTouch>>;
932
933 #[cfg(feature = "NSTouch")]
934 #[unsafe(method(allTouches))]
935 #[unsafe(method_family = none)]
936 pub unsafe fn allTouches(&self) -> Retained<NSSet<NSTouch>>;
937
938 #[cfg(all(feature = "NSResponder", feature = "NSTouch", feature = "NSView"))]
939 #[unsafe(method(touchesForView:))]
940 #[unsafe(method_family = none)]
941 pub unsafe fn touchesForView(&self, view: &NSView) -> Retained<NSSet<NSTouch>>;
942
943 #[cfg(feature = "NSTouch")]
944 #[unsafe(method(coalescedTouchesForTouch:))]
945 #[unsafe(method_family = none)]
946 pub unsafe fn coalescedTouchesForTouch(
947 &self,
948 touch: &NSTouch,
949 ) -> Retained<NSArray<NSTouch>>;
950
951 #[unsafe(method(phase))]
952 #[unsafe(method_family = none)]
953 pub unsafe fn phase(&self) -> NSEventPhase;
954
955 #[unsafe(method(stage))]
956 #[unsafe(method_family = none)]
957 pub unsafe fn stage(&self) -> NSInteger;
958
959 #[cfg(feature = "objc2-core-foundation")]
960 #[unsafe(method(stageTransition))]
961 #[unsafe(method_family = none)]
962 pub unsafe fn stageTransition(&self) -> CGFloat;
963
964 #[unsafe(method(associatedEventsMask))]
965 #[unsafe(method_family = none)]
966 pub unsafe fn associatedEventsMask(&self) -> NSEventMask;
967
968 #[unsafe(method(pressureBehavior))]
969 #[unsafe(method_family = none)]
970 pub unsafe fn pressureBehavior(&self) -> NSPressureBehavior;
971
972 #[unsafe(method(isSwipeTrackingFromScrollEventsEnabled))]
973 #[unsafe(method_family = none)]
974 pub unsafe fn isSwipeTrackingFromScrollEventsEnabled() -> bool;
975
976 #[cfg(all(feature = "block2", feature = "objc2-core-foundation"))]
977 #[unsafe(method(trackSwipeEventWithOptions:dampenAmountThresholdMin:max:usingHandler:))]
978 #[unsafe(method_family = none)]
979 pub unsafe fn trackSwipeEventWithOptions_dampenAmountThresholdMin_max_usingHandler(
980 &self,
981 options: NSEventSwipeTrackingOptions,
982 min_dampen_threshold: CGFloat,
983 max_dampen_threshold: CGFloat,
984 tracking_handler: &block2::DynBlock<dyn Fn(CGFloat, NSEventPhase, Bool, NonNull<Bool>)>,
985 );
986
987 #[unsafe(method(startPeriodicEventsAfterDelay:withPeriod:))]
988 #[unsafe(method_family = none)]
989 pub unsafe fn startPeriodicEventsAfterDelay_withPeriod(
990 delay: NSTimeInterval,
991 period: NSTimeInterval,
992 );
993
994 #[unsafe(method(stopPeriodicEvents))]
995 #[unsafe(method_family = none)]
996 pub unsafe fn stopPeriodicEvents();
997
998 #[cfg(feature = "NSGraphicsContext")]
999 #[unsafe(method(mouseEventWithType:location:modifierFlags:timestamp:windowNumber:context:eventNumber:clickCount:pressure:))]
1000 #[unsafe(method_family = none)]
1001 pub unsafe fn mouseEventWithType_location_modifierFlags_timestamp_windowNumber_context_eventNumber_clickCount_pressure(
1002 r#type: NSEventType,
1003 location: NSPoint,
1004 flags: NSEventModifierFlags,
1005 time: NSTimeInterval,
1006 w_num: NSInteger,
1007 unused_pass_nil: Option<&NSGraphicsContext>,
1008 e_num: NSInteger,
1009 c_num: NSInteger,
1010 pressure: c_float,
1011 ) -> Option<Retained<NSEvent>>;
1012
1013 #[cfg(feature = "NSGraphicsContext")]
1014 #[unsafe(method(keyEventWithType:location:modifierFlags:timestamp:windowNumber:context:characters:charactersIgnoringModifiers:isARepeat:keyCode:))]
1015 #[unsafe(method_family = none)]
1016 pub unsafe fn keyEventWithType_location_modifierFlags_timestamp_windowNumber_context_characters_charactersIgnoringModifiers_isARepeat_keyCode(
1017 r#type: NSEventType,
1018 location: NSPoint,
1019 flags: NSEventModifierFlags,
1020 time: NSTimeInterval,
1021 w_num: NSInteger,
1022 unused_pass_nil: Option<&NSGraphicsContext>,
1023 keys: &NSString,
1024 ukeys: &NSString,
1025 flag: bool,
1026 code: c_ushort,
1027 ) -> Option<Retained<NSEvent>>;
1028
1029 #[cfg(feature = "NSGraphicsContext")]
1030 #[unsafe(method(enterExitEventWithType:location:modifierFlags:timestamp:windowNumber:context:eventNumber:trackingNumber:userData:))]
1031 #[unsafe(method_family = none)]
1032 pub unsafe fn enterExitEventWithType_location_modifierFlags_timestamp_windowNumber_context_eventNumber_trackingNumber_userData(
1033 r#type: NSEventType,
1034 location: NSPoint,
1035 flags: NSEventModifierFlags,
1036 time: NSTimeInterval,
1037 w_num: NSInteger,
1038 unused_pass_nil: Option<&NSGraphicsContext>,
1039 e_num: NSInteger,
1040 t_num: NSInteger,
1041 data: *mut c_void,
1042 ) -> Option<Retained<NSEvent>>;
1043
1044 #[cfg(feature = "NSGraphicsContext")]
1045 #[unsafe(method(otherEventWithType:location:modifierFlags:timestamp:windowNumber:context:subtype:data1:data2:))]
1046 #[unsafe(method_family = none)]
1047 pub unsafe fn otherEventWithType_location_modifierFlags_timestamp_windowNumber_context_subtype_data1_data2(
1048 r#type: NSEventType,
1049 location: NSPoint,
1050 flags: NSEventModifierFlags,
1051 time: NSTimeInterval,
1052 w_num: NSInteger,
1053 unused_pass_nil: Option<&NSGraphicsContext>,
1054 subtype: c_short,
1055 d1: NSInteger,
1056 d2: NSInteger,
1057 ) -> Option<Retained<NSEvent>>;
1058
1059 #[unsafe(method(mouseLocation))]
1060 #[unsafe(method_family = none)]
1061 pub unsafe fn mouseLocation() -> NSPoint;
1062
1063 #[unsafe(method(modifierFlags))]
1064 #[unsafe(method_family = none)]
1065 pub unsafe fn modifierFlags_class() -> NSEventModifierFlags;
1066
1067 #[unsafe(method(pressedMouseButtons))]
1068 #[unsafe(method_family = none)]
1069 pub unsafe fn pressedMouseButtons() -> NSUInteger;
1070
1071 #[unsafe(method(doubleClickInterval))]
1072 #[unsafe(method_family = none)]
1073 pub unsafe fn doubleClickInterval() -> NSTimeInterval;
1074
1075 #[unsafe(method(keyRepeatDelay))]
1076 #[unsafe(method_family = none)]
1077 pub unsafe fn keyRepeatDelay() -> NSTimeInterval;
1078
1079 #[unsafe(method(keyRepeatInterval))]
1080 #[unsafe(method_family = none)]
1081 pub unsafe fn keyRepeatInterval() -> NSTimeInterval;
1082
1083 #[cfg(feature = "block2")]
1084 #[unsafe(method(addGlobalMonitorForEventsMatchingMask:handler:))]
1085 #[unsafe(method_family = none)]
1086 pub unsafe fn addGlobalMonitorForEventsMatchingMask_handler(
1087 mask: NSEventMask,
1088 block: &block2::DynBlock<dyn Fn(NonNull<NSEvent>)>,
1089 ) -> Option<Retained<AnyObject>>;
1090
1091 #[cfg(feature = "block2")]
1092 #[unsafe(method(addLocalMonitorForEventsMatchingMask:handler:))]
1093 #[unsafe(method_family = none)]
1094 pub unsafe fn addLocalMonitorForEventsMatchingMask_handler(
1095 mask: NSEventMask,
1096 block: &block2::DynBlock<dyn Fn(NonNull<NSEvent>) -> *mut NSEvent>,
1097 ) -> Option<Retained<AnyObject>>;
1098
1099 #[unsafe(method(removeMonitor:))]
1100 #[unsafe(method_family = none)]
1101 pub unsafe fn removeMonitor(event_monitor: &AnyObject);
1102 );
1103}
1104
1105impl NSEvent {
1107 extern_methods!(
1108 #[unsafe(method(init))]
1109 #[unsafe(method_family = init)]
1110 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1111
1112 #[unsafe(method(new))]
1113 #[unsafe(method_family = new)]
1114 pub unsafe fn new() -> Retained<Self>;
1115 );
1116}
1117
1118pub const NSUpArrowFunctionKey: c_uint = 0xF700;
1120pub const NSDownArrowFunctionKey: c_uint = 0xF701;
1122pub const NSLeftArrowFunctionKey: c_uint = 0xF702;
1124pub const NSRightArrowFunctionKey: c_uint = 0xF703;
1126pub const NSF1FunctionKey: c_uint = 0xF704;
1128pub const NSF2FunctionKey: c_uint = 0xF705;
1130pub const NSF3FunctionKey: c_uint = 0xF706;
1132pub const NSF4FunctionKey: c_uint = 0xF707;
1134pub const NSF5FunctionKey: c_uint = 0xF708;
1136pub const NSF6FunctionKey: c_uint = 0xF709;
1138pub const NSF7FunctionKey: c_uint = 0xF70A;
1140pub const NSF8FunctionKey: c_uint = 0xF70B;
1142pub const NSF9FunctionKey: c_uint = 0xF70C;
1144pub const NSF10FunctionKey: c_uint = 0xF70D;
1146pub const NSF11FunctionKey: c_uint = 0xF70E;
1148pub const NSF12FunctionKey: c_uint = 0xF70F;
1150pub const NSF13FunctionKey: c_uint = 0xF710;
1152pub const NSF14FunctionKey: c_uint = 0xF711;
1154pub const NSF15FunctionKey: c_uint = 0xF712;
1156pub const NSF16FunctionKey: c_uint = 0xF713;
1158pub const NSF17FunctionKey: c_uint = 0xF714;
1160pub const NSF18FunctionKey: c_uint = 0xF715;
1162pub const NSF19FunctionKey: c_uint = 0xF716;
1164pub const NSF20FunctionKey: c_uint = 0xF717;
1166pub const NSF21FunctionKey: c_uint = 0xF718;
1168pub const NSF22FunctionKey: c_uint = 0xF719;
1170pub const NSF23FunctionKey: c_uint = 0xF71A;
1172pub const NSF24FunctionKey: c_uint = 0xF71B;
1174pub const NSF25FunctionKey: c_uint = 0xF71C;
1176pub const NSF26FunctionKey: c_uint = 0xF71D;
1178pub const NSF27FunctionKey: c_uint = 0xF71E;
1180pub const NSF28FunctionKey: c_uint = 0xF71F;
1182pub const NSF29FunctionKey: c_uint = 0xF720;
1184pub const NSF30FunctionKey: c_uint = 0xF721;
1186pub const NSF31FunctionKey: c_uint = 0xF722;
1188pub const NSF32FunctionKey: c_uint = 0xF723;
1190pub const NSF33FunctionKey: c_uint = 0xF724;
1192pub const NSF34FunctionKey: c_uint = 0xF725;
1194pub const NSF35FunctionKey: c_uint = 0xF726;
1196pub const NSInsertFunctionKey: c_uint = 0xF727;
1198pub const NSDeleteFunctionKey: c_uint = 0xF728;
1200pub const NSHomeFunctionKey: c_uint = 0xF729;
1202pub const NSBeginFunctionKey: c_uint = 0xF72A;
1204pub const NSEndFunctionKey: c_uint = 0xF72B;
1206pub const NSPageUpFunctionKey: c_uint = 0xF72C;
1208pub const NSPageDownFunctionKey: c_uint = 0xF72D;
1210pub const NSPrintScreenFunctionKey: c_uint = 0xF72E;
1212pub const NSScrollLockFunctionKey: c_uint = 0xF72F;
1214pub const NSPauseFunctionKey: c_uint = 0xF730;
1216pub const NSSysReqFunctionKey: c_uint = 0xF731;
1218pub const NSBreakFunctionKey: c_uint = 0xF732;
1220pub const NSResetFunctionKey: c_uint = 0xF733;
1222pub const NSStopFunctionKey: c_uint = 0xF734;
1224pub const NSMenuFunctionKey: c_uint = 0xF735;
1226pub const NSUserFunctionKey: c_uint = 0xF736;
1228pub const NSSystemFunctionKey: c_uint = 0xF737;
1230pub const NSPrintFunctionKey: c_uint = 0xF738;
1232pub const NSClearLineFunctionKey: c_uint = 0xF739;
1234pub const NSClearDisplayFunctionKey: c_uint = 0xF73A;
1236pub const NSInsertLineFunctionKey: c_uint = 0xF73B;
1238pub const NSDeleteLineFunctionKey: c_uint = 0xF73C;
1240pub const NSInsertCharFunctionKey: c_uint = 0xF73D;
1242pub const NSDeleteCharFunctionKey: c_uint = 0xF73E;
1244pub const NSPrevFunctionKey: c_uint = 0xF73F;
1246pub const NSNextFunctionKey: c_uint = 0xF740;
1248pub const NSSelectFunctionKey: c_uint = 0xF741;
1250pub const NSExecuteFunctionKey: c_uint = 0xF742;
1252pub const NSUndoFunctionKey: c_uint = 0xF743;
1254pub const NSRedoFunctionKey: c_uint = 0xF744;
1256pub const NSFindFunctionKey: c_uint = 0xF745;
1258pub const NSHelpFunctionKey: c_uint = 0xF746;
1260pub const NSModeSwitchFunctionKey: c_uint = 0xF747;