diff --git a/proto/anki/scheduler.proto b/proto/anki/scheduler.proto index 9b489a037..87a052e79 100644 --- a/proto/anki/scheduler.proto +++ b/proto/anki/scheduler.proto @@ -319,6 +319,10 @@ message NextCardDataResponse { bool marked = 13; optional TypedAnswer typed_answer = 12; optional TimerPreferences timer = 14; + // TODO: Is it worth setting up some sort of "ReviewerPreferences" endpoint + // akin to GetGraphPreferences Also should this reviewer setting be moved to + // a config bool rather than config.meta + bool accept_enter = 15; repeated card_rendering.AVTag question_av_tags = 8; repeated card_rendering.AVTag answer_av_tags = 9; diff --git a/qt/aqt/mediasrv.py b/qt/aqt/mediasrv.py index 66e09d1bf..13b518cb5 100644 --- a/qt/aqt/mediasrv.py +++ b/qt/aqt/mediasrv.py @@ -701,6 +701,7 @@ def next_card_data() -> bytes: # Night mode is handled by the frontend so that it works with the browsers theme if used outside of anki. # Perhaps the OS class should be handled this way too? data.next_card.body_class = theme_manager.body_classes_for_card_ord(card.ord, False) + data.next_card.accept_enter = aqt.mw.pm.spacebar_rates_card() return data.SerializeToString() diff --git a/rslib/src/scheduler/service/mod.rs b/rslib/src/scheduler/service/mod.rs index 470e3d332..e5c9355c9 100644 --- a/rslib/src/scheduler/service/mod.rs +++ b/rslib/src/scheduler/service/mod.rs @@ -501,6 +501,7 @@ impl crate::services::SchedulerService for Collection { timer, // Filled by python + accept_enter: true, front: "".to_string(), back: "".to_string(), body_class: "".to_string(), diff --git a/ts/routes/reviewer/reviewer.ts b/ts/routes/reviewer/reviewer.ts index 2f9d7f232..9c01882ae 100644 --- a/ts/routes/reviewer/reviewer.ts +++ b/ts/routes/reviewer/reviewer.ts @@ -236,7 +236,7 @@ export class ReviewerState { case "enter": { if (!get(this.answerShown)) { this.showAnswer(); - } else { + } else if (this._cardData?.acceptEnter ?? true) { this.easeButtonPressed(2); } break;