mirror of
https://github.com/ankitects/anki.git
synced 2025-09-21 07:22:23 -04:00
if space/ret hit on an ease button, activate that button
This commit is contained in:
parent
64d7a3e046
commit
9d060df04c
1 changed files with 6 additions and 2 deletions
|
@ -123,6 +123,11 @@ function showans () {
|
||||||
function proctypeans (res) {
|
function proctypeans (res) {
|
||||||
$("#typeans").replaceWith(res);
|
$("#typeans").replaceWith(res);
|
||||||
}
|
}
|
||||||
|
function space() {
|
||||||
|
if (/^ease/.test(document.activeElement.href)) {
|
||||||
|
py.link(document.activeElement.href);
|
||||||
|
}
|
||||||
|
}
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
$(".ansbut").focus();
|
$(".ansbut").focus();
|
||||||
});
|
});
|
||||||
|
@ -244,8 +249,7 @@ $(".ansbut").focus();
|
||||||
if evt.key() in (Qt.Key_Enter,
|
if evt.key() in (Qt.Key_Enter,
|
||||||
Qt.Key_Return,
|
Qt.Key_Return,
|
||||||
Qt.Key_Space):
|
Qt.Key_Space):
|
||||||
self._answerCard(self._defaultEase())
|
self.web.eval("space();")
|
||||||
return True
|
|
||||||
else:
|
else:
|
||||||
key = unicode(evt.text())
|
key = unicode(evt.text())
|
||||||
if key and key >= "1" and key <= "4":
|
if key and key >= "1" and key <= "4":
|
||||||
|
|
Loading…
Reference in a new issue