-
-
Save eonist/fa2558a1b0c63aa80b6e62d960628805 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var prevStage = 0 | |
override func pressureChange(with event: NSEvent) { | |
let curStage:Int = event.stage | |
if event.pressureBehavior == NSPressureBehavior.primaryDeepClick,prevStage != curStage { | |
switch (curStage,prevStage){ | |
case (0,1): | |
Swift.print("from idle to clickStage") | |
case (1,0): | |
Swift.print("from clickStage to idle") | |
case (1,2): | |
Swift.print("from clickStage to deepClickStage") | |
case (2,1): | |
Swift.print("from deepStage to clickStage") | |
default: break;//isn't possible | |
} | |
Swift.print("stageChange") | |
prevStage = curStage/*always set prevStage to curStage on stage change*/ | |
} | |
Swift.print("pressureChange") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment