Refactor away input_key_pressed_func