Line  | Count  | Source  | 
1  | //  | |
2  | // NSEvent+CarbonConvenience.swift  | |
3  | // CutBox  | |
4  | //  | |
5  | // Created by Jason Milkins on 19/4/18.  | |
6  | // Copyright © 2018-2023 ocodo. All rights reserved.  | |
7  | //  | |
8  | ||
9  | import Cocoa  | |
10  | ||
11  | extension NSEvent { | |
12  | 30  |     var modifiers: NSEvent.ModifierFlags { | 
13  | 30  | return self.modifierFlags.intersection(.deviceIndependentFlagsMask)  | 
14  | 30  | }  | 
15  | ||
16  | // For simple use with Carbon.HIToolbox  | |
17  | 30  |     var key: Int { | 
18  | 30  | return Int(self.keyCode)  | 
19  | 30  | }  | 
20  | }  |