1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
#[cfg(feature = "block2")]
use block2::*;
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSEventType(pub NSUInteger);
impl NSEventType {
    #[doc(alias = "NSEventTypeLeftMouseDown")]
    pub const LeftMouseDown: Self = Self(1);
    #[doc(alias = "NSEventTypeLeftMouseUp")]
    pub const LeftMouseUp: Self = Self(2);
    #[doc(alias = "NSEventTypeRightMouseDown")]
    pub const RightMouseDown: Self = Self(3);
    #[doc(alias = "NSEventTypeRightMouseUp")]
    pub const RightMouseUp: Self = Self(4);
    #[doc(alias = "NSEventTypeMouseMoved")]
    pub const MouseMoved: Self = Self(5);
    #[doc(alias = "NSEventTypeLeftMouseDragged")]
    pub const LeftMouseDragged: Self = Self(6);
    #[doc(alias = "NSEventTypeRightMouseDragged")]
    pub const RightMouseDragged: Self = Self(7);
    #[doc(alias = "NSEventTypeMouseEntered")]
    pub const MouseEntered: Self = Self(8);
    #[doc(alias = "NSEventTypeMouseExited")]
    pub const MouseExited: Self = Self(9);
    #[doc(alias = "NSEventTypeKeyDown")]
    pub const KeyDown: Self = Self(10);
    #[doc(alias = "NSEventTypeKeyUp")]
    pub const KeyUp: Self = Self(11);
    #[doc(alias = "NSEventTypeFlagsChanged")]
    pub const FlagsChanged: Self = Self(12);
    #[doc(alias = "NSEventTypeAppKitDefined")]
    pub const AppKitDefined: Self = Self(13);
    #[doc(alias = "NSEventTypeSystemDefined")]
    pub const SystemDefined: Self = Self(14);
    #[doc(alias = "NSEventTypeApplicationDefined")]
    pub const ApplicationDefined: Self = Self(15);
    #[doc(alias = "NSEventTypePeriodic")]
    pub const Periodic: Self = Self(16);
    #[doc(alias = "NSEventTypeCursorUpdate")]
    pub const CursorUpdate: Self = Self(17);
    #[doc(alias = "NSEventTypeScrollWheel")]
    pub const ScrollWheel: Self = Self(22);
    #[doc(alias = "NSEventTypeTabletPoint")]
    pub const TabletPoint: Self = Self(23);
    #[doc(alias = "NSEventTypeTabletProximity")]
    pub const TabletProximity: Self = Self(24);
    #[doc(alias = "NSEventTypeOtherMouseDown")]
    pub const OtherMouseDown: Self = Self(25);
    #[doc(alias = "NSEventTypeOtherMouseUp")]
    pub const OtherMouseUp: Self = Self(26);
    #[doc(alias = "NSEventTypeOtherMouseDragged")]
    pub const OtherMouseDragged: Self = Self(27);
    #[doc(alias = "NSEventTypeGesture")]
    pub const Gesture: Self = Self(29);
    #[doc(alias = "NSEventTypeMagnify")]
    pub const Magnify: Self = Self(30);
    #[doc(alias = "NSEventTypeSwipe")]
    pub const Swipe: Self = Self(31);
    #[doc(alias = "NSEventTypeRotate")]
    pub const Rotate: Self = Self(18);
    #[doc(alias = "NSEventTypeBeginGesture")]
    pub const BeginGesture: Self = Self(19);
    #[doc(alias = "NSEventTypeEndGesture")]
    pub const EndGesture: Self = Self(20);
    #[doc(alias = "NSEventTypeSmartMagnify")]
    pub const SmartMagnify: Self = Self(32);
    #[doc(alias = "NSEventTypeQuickLook")]
    pub const QuickLook: Self = Self(33);
    #[doc(alias = "NSEventTypePressure")]
    pub const Pressure: Self = Self(34);
    #[doc(alias = "NSEventTypeDirectTouch")]
    pub const DirectTouch: Self = Self(37);
    #[doc(alias = "NSEventTypeChangeMode")]
    pub const ChangeMode: Self = Self(38);
}

unsafe impl Encode for NSEventType {
    const ENCODING: Encoding = NSUInteger::ENCODING;
}

unsafe impl RefEncode for NSEventType {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

pub static NSLeftMouseDown: NSEventType = NSEventType(NSEventType::LeftMouseDown.0);

pub static NSLeftMouseUp: NSEventType = NSEventType(NSEventType::LeftMouseUp.0);

pub static NSRightMouseDown: NSEventType = NSEventType(NSEventType::RightMouseDown.0);

pub static NSRightMouseUp: NSEventType = NSEventType(NSEventType::RightMouseUp.0);

pub static NSMouseMoved: NSEventType = NSEventType(NSEventType::MouseMoved.0);

pub static NSLeftMouseDragged: NSEventType = NSEventType(NSEventType::LeftMouseDragged.0);

pub static NSRightMouseDragged: NSEventType = NSEventType(NSEventType::RightMouseDragged.0);

pub static NSMouseEntered: NSEventType = NSEventType(NSEventType::MouseEntered.0);

pub static NSMouseExited: NSEventType = NSEventType(NSEventType::MouseExited.0);

pub static NSKeyDown: NSEventType = NSEventType(NSEventType::KeyDown.0);

pub static NSKeyUp: NSEventType = NSEventType(NSEventType::KeyUp.0);

pub static NSFlagsChanged: NSEventType = NSEventType(NSEventType::FlagsChanged.0);

pub static NSAppKitDefined: NSEventType = NSEventType(NSEventType::AppKitDefined.0);

pub static NSSystemDefined: NSEventType = NSEventType(NSEventType::SystemDefined.0);

pub static NSApplicationDefined: NSEventType = NSEventType(NSEventType::ApplicationDefined.0);

pub static NSPeriodic: NSEventType = NSEventType(NSEventType::Periodic.0);

pub static NSCursorUpdate: NSEventType = NSEventType(NSEventType::CursorUpdate.0);

pub static NSScrollWheel: NSEventType = NSEventType(NSEventType::ScrollWheel.0);

pub static NSTabletPoint: NSEventType = NSEventType(NSEventType::TabletPoint.0);

pub static NSTabletProximity: NSEventType = NSEventType(NSEventType::TabletProximity.0);

pub static NSOtherMouseDown: NSEventType = NSEventType(NSEventType::OtherMouseDown.0);

pub static NSOtherMouseUp: NSEventType = NSEventType(NSEventType::OtherMouseUp.0);

pub static NSOtherMouseDragged: NSEventType = NSEventType(NSEventType::OtherMouseDragged.0);

// NS_OPTIONS
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSEventMask(pub c_ulonglong);
impl NSEventMask {
    #[doc(alias = "NSEventMaskLeftMouseDown")]
    pub const LeftMouseDown: Self = Self(1 << NSEventType::LeftMouseDown.0);
    #[doc(alias = "NSEventMaskLeftMouseUp")]
    pub const LeftMouseUp: Self = Self(1 << NSEventType::LeftMouseUp.0);
    #[doc(alias = "NSEventMaskRightMouseDown")]
    pub const RightMouseDown: Self = Self(1 << NSEventType::RightMouseDown.0);
    #[doc(alias = "NSEventMaskRightMouseUp")]
    pub const RightMouseUp: Self = Self(1 << NSEventType::RightMouseUp.0);
    #[doc(alias = "NSEventMaskMouseMoved")]
    pub const MouseMoved: Self = Self(1 << NSEventType::MouseMoved.0);
    #[doc(alias = "NSEventMaskLeftMouseDragged")]
    pub const LeftMouseDragged: Self = Self(1 << NSEventType::LeftMouseDragged.0);
    #[doc(alias = "NSEventMaskRightMouseDragged")]
    pub const RightMouseDragged: Self = Self(1 << NSEventType::RightMouseDragged.0);
    #[doc(alias = "NSEventMaskMouseEntered")]
    pub const MouseEntered: Self = Self(1 << NSEventType::MouseEntered.0);
    #[doc(alias = "NSEventMaskMouseExited")]
    pub const MouseExited: Self = Self(1 << NSEventType::MouseExited.0);
    #[doc(alias = "NSEventMaskKeyDown")]
    pub const KeyDown: Self = Self(1 << NSEventType::KeyDown.0);
    #[doc(alias = "NSEventMaskKeyUp")]
    pub const KeyUp: Self = Self(1 << NSEventType::KeyUp.0);
    #[doc(alias = "NSEventMaskFlagsChanged")]
    pub const FlagsChanged: Self = Self(1 << NSEventType::FlagsChanged.0);
    #[doc(alias = "NSEventMaskAppKitDefined")]
    pub const AppKitDefined: Self = Self(1 << NSEventType::AppKitDefined.0);
    #[doc(alias = "NSEventMaskSystemDefined")]
    pub const SystemDefined: Self = Self(1 << NSEventType::SystemDefined.0);
    #[doc(alias = "NSEventMaskApplicationDefined")]
    pub const ApplicationDefined: Self = Self(1 << NSEventType::ApplicationDefined.0);
    #[doc(alias = "NSEventMaskPeriodic")]
    pub const Periodic: Self = Self(1 << NSEventType::Periodic.0);
    #[doc(alias = "NSEventMaskCursorUpdate")]
    pub const CursorUpdate: Self = Self(1 << NSEventType::CursorUpdate.0);
    #[doc(alias = "NSEventMaskScrollWheel")]
    pub const ScrollWheel: Self = Self(1 << NSEventType::ScrollWheel.0);
    #[doc(alias = "NSEventMaskTabletPoint")]
    pub const TabletPoint: Self = Self(1 << NSEventType::TabletPoint.0);
    #[doc(alias = "NSEventMaskTabletProximity")]
    pub const TabletProximity: Self = Self(1 << NSEventType::TabletProximity.0);
    #[doc(alias = "NSEventMaskOtherMouseDown")]
    pub const OtherMouseDown: Self = Self(1 << NSEventType::OtherMouseDown.0);
    #[doc(alias = "NSEventMaskOtherMouseUp")]
    pub const OtherMouseUp: Self = Self(1 << NSEventType::OtherMouseUp.0);
    #[doc(alias = "NSEventMaskOtherMouseDragged")]
    pub const OtherMouseDragged: Self = Self(1 << NSEventType::OtherMouseDragged.0);
    #[doc(alias = "NSEventMaskGesture")]
    pub const Gesture: Self = Self(1 << NSEventType::Gesture.0);
    #[doc(alias = "NSEventMaskMagnify")]
    pub const Magnify: Self = Self(1 << NSEventType::Magnify.0);
    #[doc(alias = "NSEventMaskSwipe")]
    pub const Swipe: Self = Self(1 << NSEventType::Swipe.0);
    #[doc(alias = "NSEventMaskRotate")]
    pub const Rotate: Self = Self(1 << NSEventType::Rotate.0);
    #[doc(alias = "NSEventMaskBeginGesture")]
    pub const BeginGesture: Self = Self(1 << NSEventType::BeginGesture.0);
    #[doc(alias = "NSEventMaskEndGesture")]
    pub const EndGesture: Self = Self(1 << NSEventType::EndGesture.0);
    #[doc(alias = "NSEventMaskSmartMagnify")]
    pub const SmartMagnify: Self = Self(1 << NSEventType::SmartMagnify.0);
    #[doc(alias = "NSEventMaskPressure")]
    pub const Pressure: Self = Self(1 << NSEventType::Pressure.0);
    #[doc(alias = "NSEventMaskDirectTouch")]
    pub const DirectTouch: Self = Self(1 << NSEventType::DirectTouch.0);
    #[doc(alias = "NSEventMaskChangeMode")]
    pub const ChangeMode: Self = Self(1 << NSEventType::ChangeMode.0);
    #[doc(alias = "NSEventMaskAny")]
    pub const Any: Self = Self(NSUIntegerMax as _);
}

unsafe impl Encode for NSEventMask {
    const ENCODING: Encoding = c_ulonglong::ENCODING;
}

unsafe impl RefEncode for NSEventMask {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

pub static NSLeftMouseDownMask: NSEventMask = NSEventMask(NSEventMask::LeftMouseDown.0);

pub static NSLeftMouseUpMask: NSEventMask = NSEventMask(NSEventMask::LeftMouseUp.0);

pub static NSRightMouseDownMask: NSEventMask = NSEventMask(NSEventMask::RightMouseDown.0);

pub static NSRightMouseUpMask: NSEventMask = NSEventMask(NSEventMask::RightMouseUp.0);

pub static NSMouseMovedMask: NSEventMask = NSEventMask(NSEventMask::MouseMoved.0);

pub static NSLeftMouseDraggedMask: NSEventMask = NSEventMask(NSEventMask::LeftMouseDragged.0);

pub static NSRightMouseDraggedMask: NSEventMask = NSEventMask(NSEventMask::RightMouseDragged.0);

pub static NSMouseEnteredMask: NSEventMask = NSEventMask(NSEventMask::MouseEntered.0);

pub static NSMouseExitedMask: NSEventMask = NSEventMask(NSEventMask::MouseExited.0);

pub static NSKeyDownMask: NSEventMask = NSEventMask(NSEventMask::KeyDown.0);

pub static NSKeyUpMask: NSEventMask = NSEventMask(NSEventMask::KeyUp.0);

pub static NSFlagsChangedMask: NSEventMask = NSEventMask(NSEventMask::FlagsChanged.0);

pub static NSAppKitDefinedMask: NSEventMask = NSEventMask(NSEventMask::AppKitDefined.0);

pub static NSSystemDefinedMask: NSEventMask = NSEventMask(NSEventMask::SystemDefined.0);

pub static NSApplicationDefinedMask: NSEventMask = NSEventMask(NSEventMask::ApplicationDefined.0);

pub static NSPeriodicMask: NSEventMask = NSEventMask(NSEventMask::Periodic.0);

pub static NSCursorUpdateMask: NSEventMask = NSEventMask(NSEventMask::CursorUpdate.0);

pub static NSScrollWheelMask: NSEventMask = NSEventMask(NSEventMask::ScrollWheel.0);

pub static NSTabletPointMask: NSEventMask = NSEventMask(NSEventMask::TabletPoint.0);

pub static NSTabletProximityMask: NSEventMask = NSEventMask(NSEventMask::TabletProximity.0);

pub static NSOtherMouseDownMask: NSEventMask = NSEventMask(NSEventMask::OtherMouseDown.0);

pub static NSOtherMouseUpMask: NSEventMask = NSEventMask(NSEventMask::OtherMouseUp.0);

pub static NSOtherMouseDraggedMask: NSEventMask = NSEventMask(NSEventMask::OtherMouseDragged.0);

pub static NSAnyEventMask: NSEventMask = NSEventMask(NSUIntegerMax as _);

// TODO: pub fn NSEventMaskFromType(r#type: NSEventType,) -> NSEventMask;

// NS_OPTIONS
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSEventModifierFlags(pub NSUInteger);
impl NSEventModifierFlags {
    pub const NSEventModifierFlagCapsLock: Self = Self(1 << 16);
    pub const NSEventModifierFlagShift: Self = Self(1 << 17);
    pub const NSEventModifierFlagControl: Self = Self(1 << 18);
    pub const NSEventModifierFlagOption: Self = Self(1 << 19);
    pub const NSEventModifierFlagCommand: Self = Self(1 << 20);
    pub const NSEventModifierFlagNumericPad: Self = Self(1 << 21);
    pub const NSEventModifierFlagHelp: Self = Self(1 << 22);
    pub const NSEventModifierFlagFunction: Self = Self(1 << 23);
    pub const NSEventModifierFlagDeviceIndependentFlagsMask: Self = Self(0xffff0000);
}

unsafe impl Encode for NSEventModifierFlags {
    const ENCODING: Encoding = NSUInteger::ENCODING;
}

unsafe impl RefEncode for NSEventModifierFlags {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

pub static NSAlphaShiftKeyMask: NSEventModifierFlags =
    NSEventModifierFlags(NSEventModifierFlags::NSEventModifierFlagCapsLock.0);

pub static NSShiftKeyMask: NSEventModifierFlags =
    NSEventModifierFlags(NSEventModifierFlags::NSEventModifierFlagShift.0);

pub static NSControlKeyMask: NSEventModifierFlags =
    NSEventModifierFlags(NSEventModifierFlags::NSEventModifierFlagControl.0);

pub static NSAlternateKeyMask: NSEventModifierFlags =
    NSEventModifierFlags(NSEventModifierFlags::NSEventModifierFlagOption.0);

pub static NSCommandKeyMask: NSEventModifierFlags =
    NSEventModifierFlags(NSEventModifierFlags::NSEventModifierFlagCommand.0);

pub static NSNumericPadKeyMask: NSEventModifierFlags =
    NSEventModifierFlags(NSEventModifierFlags::NSEventModifierFlagNumericPad.0);

pub static NSHelpKeyMask: NSEventModifierFlags =
    NSEventModifierFlags(NSEventModifierFlags::NSEventModifierFlagHelp.0);

pub static NSFunctionKeyMask: NSEventModifierFlags =
    NSEventModifierFlags(NSEventModifierFlags::NSEventModifierFlagFunction.0);

pub static NSDeviceIndependentModifierFlagsMask: NSEventModifierFlags =
    NSEventModifierFlags(NSEventModifierFlags::NSEventModifierFlagDeviceIndependentFlagsMask.0);

// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSPointingDeviceType(pub NSUInteger);
impl NSPointingDeviceType {
    #[doc(alias = "NSPointingDeviceTypeUnknown")]
    pub const Unknown: Self = Self(0);
    #[doc(alias = "NSPointingDeviceTypePen")]
    pub const Pen: Self = Self(1);
    #[doc(alias = "NSPointingDeviceTypeCursor")]
    pub const Cursor: Self = Self(2);
    #[doc(alias = "NSPointingDeviceTypeEraser")]
    pub const Eraser: Self = Self(3);
}

unsafe impl Encode for NSPointingDeviceType {
    const ENCODING: Encoding = NSUInteger::ENCODING;
}

unsafe impl RefEncode for NSPointingDeviceType {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

pub static NSUnknownPointingDevice: NSPointingDeviceType =
    NSPointingDeviceType(NSPointingDeviceType::Unknown.0);

pub static NSPenPointingDevice: NSPointingDeviceType =
    NSPointingDeviceType(NSPointingDeviceType::Pen.0);

pub static NSCursorPointingDevice: NSPointingDeviceType =
    NSPointingDeviceType(NSPointingDeviceType::Cursor.0);

pub static NSEraserPointingDevice: NSPointingDeviceType =
    NSPointingDeviceType(NSPointingDeviceType::Eraser.0);

// NS_OPTIONS
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSEventButtonMask(pub NSUInteger);
impl NSEventButtonMask {
    #[doc(alias = "NSEventButtonMaskPenTip")]
    pub const PenTip: Self = Self(1);
    #[doc(alias = "NSEventButtonMaskPenLowerSide")]
    pub const PenLowerSide: Self = Self(2);
    #[doc(alias = "NSEventButtonMaskPenUpperSide")]
    pub const PenUpperSide: Self = Self(4);
}

unsafe impl Encode for NSEventButtonMask {
    const ENCODING: Encoding = NSUInteger::ENCODING;
}

unsafe impl RefEncode for NSEventButtonMask {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

pub static NSPenTipMask: NSEventButtonMask = NSEventButtonMask(NSEventButtonMask::PenTip.0);

pub static NSPenLowerSideMask: NSEventButtonMask =
    NSEventButtonMask(NSEventButtonMask::PenLowerSide.0);

pub static NSPenUpperSideMask: NSEventButtonMask =
    NSEventButtonMask(NSEventButtonMask::PenUpperSide.0);

// NS_OPTIONS
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSEventPhase(pub NSUInteger);
impl NSEventPhase {
    #[doc(alias = "NSEventPhaseNone")]
    pub const None: Self = Self(0);
    #[doc(alias = "NSEventPhaseBegan")]
    pub const Began: Self = Self(0x1 << 0);
    #[doc(alias = "NSEventPhaseStationary")]
    pub const Stationary: Self = Self(0x1 << 1);
    #[doc(alias = "NSEventPhaseChanged")]
    pub const Changed: Self = Self(0x1 << 2);
    #[doc(alias = "NSEventPhaseEnded")]
    pub const Ended: Self = Self(0x1 << 3);
    #[doc(alias = "NSEventPhaseCancelled")]
    pub const Cancelled: Self = Self(0x1 << 4);
    #[doc(alias = "NSEventPhaseMayBegin")]
    pub const MayBegin: Self = Self(0x1 << 5);
}

unsafe impl Encode for NSEventPhase {
    const ENCODING: Encoding = NSUInteger::ENCODING;
}

unsafe impl RefEncode for NSEventPhase {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSEventGestureAxis(pub NSInteger);
impl NSEventGestureAxis {
    #[doc(alias = "NSEventGestureAxisNone")]
    pub const None: Self = Self(0);
    #[doc(alias = "NSEventGestureAxisHorizontal")]
    pub const Horizontal: Self = Self(1);
    #[doc(alias = "NSEventGestureAxisVertical")]
    pub const Vertical: Self = Self(2);
}

unsafe impl Encode for NSEventGestureAxis {
    const ENCODING: Encoding = NSInteger::ENCODING;
}

unsafe impl RefEncode for NSEventGestureAxis {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

// NS_OPTIONS
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSEventSwipeTrackingOptions(pub NSUInteger);
impl NSEventSwipeTrackingOptions {
    pub const NSEventSwipeTrackingLockDirection: Self = Self(0x1 << 0);
    pub const NSEventSwipeTrackingClampGestureAmount: Self = Self(0x1 << 1);
}

unsafe impl Encode for NSEventSwipeTrackingOptions {
    const ENCODING: Encoding = NSUInteger::ENCODING;
}

unsafe impl RefEncode for NSEventSwipeTrackingOptions {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSEventSubtype(pub c_short);
impl NSEventSubtype {
    #[doc(alias = "NSEventSubtypeWindowExposed")]
    pub const WindowExposed: Self = Self(0);
    #[doc(alias = "NSEventSubtypeApplicationActivated")]
    pub const ApplicationActivated: Self = Self(1);
    #[doc(alias = "NSEventSubtypeApplicationDeactivated")]
    pub const ApplicationDeactivated: Self = Self(2);
    #[doc(alias = "NSEventSubtypeWindowMoved")]
    pub const WindowMoved: Self = Self(4);
    #[doc(alias = "NSEventSubtypeScreenChanged")]
    pub const ScreenChanged: Self = Self(8);
    #[doc(alias = "NSEventSubtypePowerOff")]
    pub const PowerOff: Self = Self(1);
    #[doc(alias = "NSEventSubtypeMouseEvent")]
    pub const MouseEvent: Self = Self(0);
    #[doc(alias = "NSEventSubtypeTabletPoint")]
    pub const TabletPoint: Self = Self(1);
    #[doc(alias = "NSEventSubtypeTabletProximity")]
    pub const TabletProximity: Self = Self(2);
    #[doc(alias = "NSEventSubtypeTouch")]
    pub const Touch: Self = Self(3);
}

unsafe impl Encode for NSEventSubtype {
    const ENCODING: Encoding = c_short::ENCODING;
}

unsafe impl RefEncode for NSEventSubtype {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

pub static NSWindowExposedEventType: NSEventSubtype =
    NSEventSubtype(NSEventSubtype::WindowExposed.0);

pub static NSApplicationActivatedEventType: NSEventSubtype =
    NSEventSubtype(NSEventSubtype::ApplicationActivated.0);

pub static NSApplicationDeactivatedEventType: NSEventSubtype =
    NSEventSubtype(NSEventSubtype::ApplicationDeactivated.0);

pub static NSWindowMovedEventType: NSEventSubtype = NSEventSubtype(NSEventSubtype::WindowMoved.0);

pub static NSScreenChangedEventType: NSEventSubtype =
    NSEventSubtype(NSEventSubtype::ScreenChanged.0);

pub static NSAWTEventType: NSEventSubtype = NSEventSubtype(16);

pub static NSPowerOffEventType: NSEventSubtype = NSEventSubtype(NSEventSubtype::PowerOff.0);

pub static NSMouseEventSubtype: NSEventSubtype = NSEventSubtype(NSEventSubtype::MouseEvent.0);

pub static NSTabletPointEventSubtype: NSEventSubtype =
    NSEventSubtype(NSEventSubtype::TabletPoint.0);

pub static NSTabletProximityEventSubtype: NSEventSubtype =
    NSEventSubtype(NSEventSubtype::TabletProximity.0);

pub static NSTouchEventSubtype: NSEventSubtype = NSEventSubtype(NSEventSubtype::Touch.0);

// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSPressureBehavior(pub NSInteger);
impl NSPressureBehavior {
    #[doc(alias = "NSPressureBehaviorUnknown")]
    pub const Unknown: Self = Self(-1);
    #[doc(alias = "NSPressureBehaviorPrimaryDefault")]
    pub const PrimaryDefault: Self = Self(0);
    #[doc(alias = "NSPressureBehaviorPrimaryClick")]
    pub const PrimaryClick: Self = Self(1);
    #[doc(alias = "NSPressureBehaviorPrimaryGeneric")]
    pub const PrimaryGeneric: Self = Self(2);
    #[doc(alias = "NSPressureBehaviorPrimaryAccelerator")]
    pub const PrimaryAccelerator: Self = Self(3);
    #[doc(alias = "NSPressureBehaviorPrimaryDeepClick")]
    pub const PrimaryDeepClick: Self = Self(5);
    #[doc(alias = "NSPressureBehaviorPrimaryDeepDrag")]
    pub const PrimaryDeepDrag: Self = Self(6);
}

unsafe impl Encode for NSPressureBehavior {
    const ENCODING: Encoding = NSInteger::ENCODING;
}

unsafe impl RefEncode for NSPressureBehavior {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct NSEvent;

    unsafe impl ClassType for NSEvent {
        type Super = NSObject;
        type Mutability = Immutable;
    }
);

unsafe impl NSCoding for NSEvent {}

unsafe impl NSCopying for NSEvent {}

unsafe impl NSObjectProtocol for NSEvent {}

extern_methods!(
    unsafe impl NSEvent {
        #[method(type)]
        pub unsafe fn r#type(&self) -> NSEventType;

        #[method(modifierFlags)]
        pub unsafe fn modifierFlags(&self) -> NSEventModifierFlags;

        #[method(timestamp)]
        pub unsafe fn timestamp(&self) -> NSTimeInterval;

        #[cfg(all(feature = "NSResponder", feature = "NSWindow"))]
        #[method_id(@__retain_semantics Other window)]
        pub unsafe fn window(&self, mtm: MainThreadMarker) -> Option<Id<NSWindow>>;

        #[method(windowNumber)]
        pub unsafe fn windowNumber(&self) -> NSInteger;

        #[cfg(feature = "NSGraphicsContext")]
        #[deprecated = "This method always returns nil. If you need access to the current drawing context, use [NSGraphicsContext currentContext] inside of a draw operation."]
        #[method_id(@__retain_semantics Other context)]
        pub unsafe fn context(&self) -> Option<Id<NSGraphicsContext>>;

        #[method(clickCount)]
        pub unsafe fn clickCount(&self) -> NSInteger;

        #[method(buttonNumber)]
        pub unsafe fn buttonNumber(&self) -> NSInteger;

        #[method(eventNumber)]
        pub unsafe fn eventNumber(&self) -> NSInteger;

        #[method(pressure)]
        pub unsafe fn pressure(&self) -> c_float;

        #[method(locationInWindow)]
        pub unsafe fn locationInWindow(&self) -> NSPoint;

        #[method(deltaX)]
        pub unsafe fn deltaX(&self) -> CGFloat;

        #[method(deltaY)]
        pub unsafe fn deltaY(&self) -> CGFloat;

        #[method(deltaZ)]
        pub unsafe fn deltaZ(&self) -> CGFloat;

        #[method(hasPreciseScrollingDeltas)]
        pub unsafe fn hasPreciseScrollingDeltas(&self) -> bool;

        #[method(scrollingDeltaX)]
        pub unsafe fn scrollingDeltaX(&self) -> CGFloat;

        #[method(scrollingDeltaY)]
        pub unsafe fn scrollingDeltaY(&self) -> CGFloat;

        #[method(momentumPhase)]
        pub unsafe fn momentumPhase(&self) -> NSEventPhase;

        #[method(isDirectionInvertedFromDevice)]
        pub unsafe fn isDirectionInvertedFromDevice(&self) -> bool;

        #[method_id(@__retain_semantics Other characters)]
        pub unsafe fn characters(&self) -> Option<Id<NSString>>;

        #[method_id(@__retain_semantics Other charactersIgnoringModifiers)]
        pub unsafe fn charactersIgnoringModifiers(&self) -> Option<Id<NSString>>;

        #[method_id(@__retain_semantics Other charactersByApplyingModifiers:)]
        pub unsafe fn charactersByApplyingModifiers(
            &self,
            modifiers: NSEventModifierFlags,
        ) -> Option<Id<NSString>>;

        #[method(isARepeat)]
        pub unsafe fn isARepeat(&self) -> bool;

        #[method(keyCode)]
        pub unsafe fn keyCode(&self) -> c_ushort;

        #[method(trackingNumber)]
        pub unsafe fn trackingNumber(&self) -> NSInteger;

        #[method(userData)]
        pub unsafe fn userData(&self) -> *mut c_void;

        #[cfg(feature = "NSTrackingArea")]
        #[method_id(@__retain_semantics Other trackingArea)]
        pub unsafe fn trackingArea(&self) -> Option<Id<NSTrackingArea>>;

        #[method(subtype)]
        pub unsafe fn subtype(&self) -> NSEventSubtype;

        #[method(data1)]
        pub unsafe fn data1(&self) -> NSInteger;

        #[method(data2)]
        pub unsafe fn data2(&self) -> NSInteger;

        #[method(eventRef)]
        pub unsafe fn eventRef(&self) -> *mut c_void;

        #[method_id(@__retain_semantics Other eventWithEventRef:)]
        pub unsafe fn eventWithEventRef(event_ref: NonNull<c_void>) -> Option<Id<NSEvent>>;

        #[method(isMouseCoalescingEnabled)]
        pub unsafe fn isMouseCoalescingEnabled() -> bool;

        #[method(setMouseCoalescingEnabled:)]
        pub unsafe fn setMouseCoalescingEnabled(mouse_coalescing_enabled: bool);

        #[method(magnification)]
        pub unsafe fn magnification(&self) -> CGFloat;

        #[method(deviceID)]
        pub unsafe fn deviceID(&self) -> NSUInteger;

        #[method(rotation)]
        pub unsafe fn rotation(&self) -> c_float;

        #[method(absoluteX)]
        pub unsafe fn absoluteX(&self) -> NSInteger;

        #[method(absoluteY)]
        pub unsafe fn absoluteY(&self) -> NSInteger;

        #[method(absoluteZ)]
        pub unsafe fn absoluteZ(&self) -> NSInteger;

        #[method(buttonMask)]
        pub unsafe fn buttonMask(&self) -> NSEventButtonMask;

        #[method(tilt)]
        pub unsafe fn tilt(&self) -> NSPoint;

        #[method(tangentialPressure)]
        pub unsafe fn tangentialPressure(&self) -> c_float;

        #[method_id(@__retain_semantics Other vendorDefined)]
        pub unsafe fn vendorDefined(&self) -> Id<AnyObject>;

        #[method(vendorID)]
        pub unsafe fn vendorID(&self) -> NSUInteger;

        #[method(tabletID)]
        pub unsafe fn tabletID(&self) -> NSUInteger;

        #[method(pointingDeviceID)]
        pub unsafe fn pointingDeviceID(&self) -> NSUInteger;

        #[method(systemTabletID)]
        pub unsafe fn systemTabletID(&self) -> NSUInteger;

        #[method(vendorPointingDeviceType)]
        pub unsafe fn vendorPointingDeviceType(&self) -> NSUInteger;

        #[method(pointingDeviceSerialNumber)]
        pub unsafe fn pointingDeviceSerialNumber(&self) -> NSUInteger;

        #[method(uniqueID)]
        pub unsafe fn uniqueID(&self) -> c_ulonglong;

        #[method(capabilityMask)]
        pub unsafe fn capabilityMask(&self) -> NSUInteger;

        #[method(pointingDeviceType)]
        pub unsafe fn pointingDeviceType(&self) -> NSPointingDeviceType;

        #[method(isEnteringProximity)]
        pub unsafe fn isEnteringProximity(&self) -> bool;

        #[cfg(all(feature = "NSResponder", feature = "NSTouch", feature = "NSView"))]
        #[method_id(@__retain_semantics Other touchesMatchingPhase:inView:)]
        pub unsafe fn touchesMatchingPhase_inView(
            &self,
            phase: NSTouchPhase,
            view: Option<&NSView>,
        ) -> Id<NSSet<NSTouch>>;

        #[cfg(feature = "NSTouch")]
        #[method_id(@__retain_semantics Other allTouches)]
        pub unsafe fn allTouches(&self) -> Id<NSSet<NSTouch>>;

        #[cfg(all(feature = "NSResponder", feature = "NSTouch", feature = "NSView"))]
        #[method_id(@__retain_semantics Other touchesForView:)]
        pub unsafe fn touchesForView(&self, view: &NSView) -> Id<NSSet<NSTouch>>;

        #[cfg(feature = "NSTouch")]
        #[method_id(@__retain_semantics Other coalescedTouchesForTouch:)]
        pub unsafe fn coalescedTouchesForTouch(&self, touch: &NSTouch) -> Id<NSArray<NSTouch>>;

        #[method(phase)]
        pub unsafe fn phase(&self) -> NSEventPhase;

        #[method(stage)]
        pub unsafe fn stage(&self) -> NSInteger;

        #[method(stageTransition)]
        pub unsafe fn stageTransition(&self) -> CGFloat;

        #[method(associatedEventsMask)]
        pub unsafe fn associatedEventsMask(&self) -> NSEventMask;

        #[method(pressureBehavior)]
        pub unsafe fn pressureBehavior(&self) -> NSPressureBehavior;

        #[method(isSwipeTrackingFromScrollEventsEnabled)]
        pub unsafe fn isSwipeTrackingFromScrollEventsEnabled() -> bool;

        #[cfg(feature = "block2")]
        #[method(trackSwipeEventWithOptions:dampenAmountThresholdMin:max:usingHandler:)]
        pub unsafe fn trackSwipeEventWithOptions_dampenAmountThresholdMin_max_usingHandler(
            &self,
            options: NSEventSwipeTrackingOptions,
            min_dampen_threshold: CGFloat,
            max_dampen_threshold: CGFloat,
            tracking_handler: &Block<dyn Fn(CGFloat, NSEventPhase, Bool, NonNull<Bool>)>,
        );

        #[method(startPeriodicEventsAfterDelay:withPeriod:)]
        pub unsafe fn startPeriodicEventsAfterDelay_withPeriod(
            delay: NSTimeInterval,
            period: NSTimeInterval,
        );

        #[method(stopPeriodicEvents)]
        pub unsafe fn stopPeriodicEvents();

        #[cfg(feature = "NSGraphicsContext")]
        #[method_id(@__retain_semantics Other mouseEventWithType:location:modifierFlags:timestamp:windowNumber:context:eventNumber:clickCount:pressure:)]
        pub unsafe fn mouseEventWithType_location_modifierFlags_timestamp_windowNumber_context_eventNumber_clickCount_pressure(
            r#type: NSEventType,
            location: NSPoint,
            flags: NSEventModifierFlags,
            time: NSTimeInterval,
            w_num: NSInteger,
            unused_pass_nil: Option<&NSGraphicsContext>,
            e_num: NSInteger,
            c_num: NSInteger,
            pressure: c_float,
        ) -> Option<Id<NSEvent>>;

        #[cfg(feature = "NSGraphicsContext")]
        #[method_id(@__retain_semantics Other keyEventWithType:location:modifierFlags:timestamp:windowNumber:context:characters:charactersIgnoringModifiers:isARepeat:keyCode:)]
        pub unsafe fn keyEventWithType_location_modifierFlags_timestamp_windowNumber_context_characters_charactersIgnoringModifiers_isARepeat_keyCode(
            r#type: NSEventType,
            location: NSPoint,
            flags: NSEventModifierFlags,
            time: NSTimeInterval,
            w_num: NSInteger,
            unused_pass_nil: Option<&NSGraphicsContext>,
            keys: &NSString,
            ukeys: &NSString,
            flag: bool,
            code: c_ushort,
        ) -> Option<Id<NSEvent>>;

        #[cfg(feature = "NSGraphicsContext")]
        #[method_id(@__retain_semantics Other enterExitEventWithType:location:modifierFlags:timestamp:windowNumber:context:eventNumber:trackingNumber:userData:)]
        pub unsafe fn enterExitEventWithType_location_modifierFlags_timestamp_windowNumber_context_eventNumber_trackingNumber_userData(
            r#type: NSEventType,
            location: NSPoint,
            flags: NSEventModifierFlags,
            time: NSTimeInterval,
            w_num: NSInteger,
            unused_pass_nil: Option<&NSGraphicsContext>,
            e_num: NSInteger,
            t_num: NSInteger,
            data: *mut c_void,
        ) -> Option<Id<NSEvent>>;

        #[cfg(feature = "NSGraphicsContext")]
        #[method_id(@__retain_semantics Other otherEventWithType:location:modifierFlags:timestamp:windowNumber:context:subtype:data1:data2:)]
        pub unsafe fn otherEventWithType_location_modifierFlags_timestamp_windowNumber_context_subtype_data1_data2(
            r#type: NSEventType,
            location: NSPoint,
            flags: NSEventModifierFlags,
            time: NSTimeInterval,
            w_num: NSInteger,
            unused_pass_nil: Option<&NSGraphicsContext>,
            subtype: c_short,
            d1: NSInteger,
            d2: NSInteger,
        ) -> Option<Id<NSEvent>>;

        #[method(mouseLocation)]
        pub unsafe fn mouseLocation() -> NSPoint;

        #[method(modifierFlags)]
        pub unsafe fn modifierFlags_class() -> NSEventModifierFlags;

        #[method(pressedMouseButtons)]
        pub unsafe fn pressedMouseButtons() -> NSUInteger;

        #[method(doubleClickInterval)]
        pub unsafe fn doubleClickInterval() -> NSTimeInterval;

        #[method(keyRepeatDelay)]
        pub unsafe fn keyRepeatDelay() -> NSTimeInterval;

        #[method(keyRepeatInterval)]
        pub unsafe fn keyRepeatInterval() -> NSTimeInterval;

        #[cfg(feature = "block2")]
        #[method_id(@__retain_semantics Other addGlobalMonitorForEventsMatchingMask:handler:)]
        pub unsafe fn addGlobalMonitorForEventsMatchingMask_handler(
            mask: NSEventMask,
            block: &Block<dyn Fn(NonNull<NSEvent>)>,
        ) -> Option<Id<AnyObject>>;

        #[cfg(feature = "block2")]
        #[method_id(@__retain_semantics Other addLocalMonitorForEventsMatchingMask:handler:)]
        pub unsafe fn addLocalMonitorForEventsMatchingMask_handler(
            mask: NSEventMask,
            block: &Block<dyn Fn(NonNull<NSEvent>) -> *mut NSEvent>,
        ) -> Option<Id<AnyObject>>;

        #[method(removeMonitor:)]
        pub unsafe fn removeMonitor(event_monitor: &AnyObject);
    }
);

extern_methods!(
    /// Methods declared on superclass `NSObject`
    unsafe impl NSEvent {
        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Allocated<Self>) -> Id<Self>;

        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new() -> Id<Self>;
    }
);

pub const NSUpArrowFunctionKey: c_uint = 0xF700;
pub const NSDownArrowFunctionKey: c_uint = 0xF701;
pub const NSLeftArrowFunctionKey: c_uint = 0xF702;
pub const NSRightArrowFunctionKey: c_uint = 0xF703;
pub const NSF1FunctionKey: c_uint = 0xF704;
pub const NSF2FunctionKey: c_uint = 0xF705;
pub const NSF3FunctionKey: c_uint = 0xF706;
pub const NSF4FunctionKey: c_uint = 0xF707;
pub const NSF5FunctionKey: c_uint = 0xF708;
pub const NSF6FunctionKey: c_uint = 0xF709;
pub const NSF7FunctionKey: c_uint = 0xF70A;
pub const NSF8FunctionKey: c_uint = 0xF70B;
pub const NSF9FunctionKey: c_uint = 0xF70C;
pub const NSF10FunctionKey: c_uint = 0xF70D;
pub const NSF11FunctionKey: c_uint = 0xF70E;
pub const NSF12FunctionKey: c_uint = 0xF70F;
pub const NSF13FunctionKey: c_uint = 0xF710;
pub const NSF14FunctionKey: c_uint = 0xF711;
pub const NSF15FunctionKey: c_uint = 0xF712;
pub const NSF16FunctionKey: c_uint = 0xF713;
pub const NSF17FunctionKey: c_uint = 0xF714;
pub const NSF18FunctionKey: c_uint = 0xF715;
pub const NSF19FunctionKey: c_uint = 0xF716;
pub const NSF20FunctionKey: c_uint = 0xF717;
pub const NSF21FunctionKey: c_uint = 0xF718;
pub const NSF22FunctionKey: c_uint = 0xF719;
pub const NSF23FunctionKey: c_uint = 0xF71A;
pub const NSF24FunctionKey: c_uint = 0xF71B;
pub const NSF25FunctionKey: c_uint = 0xF71C;
pub const NSF26FunctionKey: c_uint = 0xF71D;
pub const NSF27FunctionKey: c_uint = 0xF71E;
pub const NSF28FunctionKey: c_uint = 0xF71F;
pub const NSF29FunctionKey: c_uint = 0xF720;
pub const NSF30FunctionKey: c_uint = 0xF721;
pub const NSF31FunctionKey: c_uint = 0xF722;
pub const NSF32FunctionKey: c_uint = 0xF723;
pub const NSF33FunctionKey: c_uint = 0xF724;
pub const NSF34FunctionKey: c_uint = 0xF725;
pub const NSF35FunctionKey: c_uint = 0xF726;
pub const NSInsertFunctionKey: c_uint = 0xF727;
pub const NSDeleteFunctionKey: c_uint = 0xF728;
pub const NSHomeFunctionKey: c_uint = 0xF729;
pub const NSBeginFunctionKey: c_uint = 0xF72A;
pub const NSEndFunctionKey: c_uint = 0xF72B;
pub const NSPageUpFunctionKey: c_uint = 0xF72C;
pub const NSPageDownFunctionKey: c_uint = 0xF72D;
pub const NSPrintScreenFunctionKey: c_uint = 0xF72E;
pub const NSScrollLockFunctionKey: c_uint = 0xF72F;
pub const NSPauseFunctionKey: c_uint = 0xF730;
pub const NSSysReqFunctionKey: c_uint = 0xF731;
pub const NSBreakFunctionKey: c_uint = 0xF732;
pub const NSResetFunctionKey: c_uint = 0xF733;
pub const NSStopFunctionKey: c_uint = 0xF734;
pub const NSMenuFunctionKey: c_uint = 0xF735;
pub const NSUserFunctionKey: c_uint = 0xF736;
pub const NSSystemFunctionKey: c_uint = 0xF737;
pub const NSPrintFunctionKey: c_uint = 0xF738;
pub const NSClearLineFunctionKey: c_uint = 0xF739;
pub const NSClearDisplayFunctionKey: c_uint = 0xF73A;
pub const NSInsertLineFunctionKey: c_uint = 0xF73B;
pub const NSDeleteLineFunctionKey: c_uint = 0xF73C;
pub const NSInsertCharFunctionKey: c_uint = 0xF73D;
pub const NSDeleteCharFunctionKey: c_uint = 0xF73E;
pub const NSPrevFunctionKey: c_uint = 0xF73F;
pub const NSNextFunctionKey: c_uint = 0xF740;
pub const NSSelectFunctionKey: c_uint = 0xF741;
pub const NSExecuteFunctionKey: c_uint = 0xF742;
pub const NSUndoFunctionKey: c_uint = 0xF743;
pub const NSRedoFunctionKey: c_uint = 0xF744;
pub const NSFindFunctionKey: c_uint = 0xF745;
pub const NSHelpFunctionKey: c_uint = 0xF746;
pub const NSModeSwitchFunctionKey: c_uint = 0xF747;