         let affinity: NSSelectionAffinity = (currentIndex < clickedIndex) ? .upstream : .downstream
         
         // with Command key (add selection)
-        if NSEvent.modifierFlags.contains(.command) {
+        if event.modifierFlags.contains(.command) {
             var selectedRanges = [NSRange]()
             var intersects = false
             

    private var opacityObserver: AnyCancellable?
    private var textViewSubscriptions: Set<AnyCancellable> = []
    
    private weak var draggingTimer: Timer?
    
    @IBOutlet private weak var textView: NSTextView? {
        

        }
        
        // with Shift key (expand selection)
        if event.modifierFlags.contains(.shift) {
            let selectedRange = textView.selectedRange
            if selectedRange.contains(currentIndex) {  // reduce
                let inUpperSelection = (currentIndex - selectedRange.location) < selectedRange.length / 2
