I think you could just use if action == PRESS and key == KEY_F if there is no other case