(Apple) Put safeguards around input_state/button_pressed functions