(Apple) apple_input.c - refactor