(Apple) Split up keyboard event code into its own file