Skip to content

Instantly share code, notes, and snippets.

@harryworld
Created January 27, 2016 02:32
Show Gist options
  • Save harryworld/fa580aeaf52509768e7d to your computer and use it in GitHub Desktop.
Save harryworld/fa580aeaf52509768e7d to your computer and use it in GitHub Desktop.
//
// ShiftClickGestureRecognizer.swift
//
// Created by Harry Ng on 27/1/2016.
// Copyright © 2016 STAY REAL. All rights reserved.
//
import Cocoa
class ShiftClickGestureRecognizer: NSClickGestureRecognizer {
override init(target: AnyObject, action: Selector) {
super.init(target: target, action: action)
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
override func mouseDown(event: NSEvent) {
if (event.modifierFlags.rawValue & NSEventModifierFlags.ShiftKeyMask.rawValue) == NSEventModifierFlags.ShiftKeyMask.rawValue {
super.mouseDown(event)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment