How do you use CGEventTapCreate in Swift?
The callback parameter of CGEventTapCreate() is a C function pointer, and in Swift 1.x it is not possible call it with a Swift function argument. However, in Swift 2 (Xcode 7), C functions that take function pointer arguments can be called using closures or global functions (with the restriction that the closure must not capture … Read more