From 9d060df04c4195c386de7ce2992d2441ba2ce36d Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Fri, 25 Mar 2011 09:58:35 +0900 Subject: [PATCH] if space/ret hit on an ease button, activate that button --- aqt/reviewer.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/aqt/reviewer.py b/aqt/reviewer.py index b778c6cf8..36ad245b0 100644 --- a/aqt/reviewer.py +++ b/aqt/reviewer.py @@ -123,6 +123,11 @@ function showans () { function proctypeans (res) { $("#typeans").replaceWith(res); } +function space() { + if (/^ease/.test(document.activeElement.href)) { + py.link(document.activeElement.href); + } +} $(document).ready(function () { $(".ansbut").focus(); }); @@ -244,8 +249,7 @@ $(".ansbut").focus(); if evt.key() in (Qt.Key_Enter, Qt.Key_Return, Qt.Key_Space): - self._answerCard(self._defaultEase()) - return True + self.web.eval("space();") else: key = unicode(evt.text()) if key and key >= "1" and key <= "4":