Fix setting exit_on_escape atribute on on_keyboard method (#1967)