(OSX) Reimplement sendEvent function - turn it into a switch