-
-
Save cobbal/303491c7c87d2ed3364e 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
func keyDown(theEvent: NSEvent) { | |
func intToString(x : Int) -> String { | |
return String(UnicodeScalar(x)) | |
} | |
let hasCommand = (theEvent.modifierFlags & .CommandKeyMask).value != 0 | |
switch theEvent.charactersIgnoringModifiers! { | |
case intToString(NSUpArrowFunctionKey) where hasCommand == true: | |
// Scroll to top | |
break | |
case intToString(NSDownArrowFunctionKey) where hasCommand == true: | |
// Scroll to bottom | |
break | |
case intToString(NSRightArrowFunctionKey) where hasCommand == true: | |
// Select the current row | |
break | |
case " ": | |
// Scroll down one page | |
break | |
default: | |
super.keyDown(theEvent) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment