Only compile HandleKeyboardEvent on Mac