Created
February 26, 2017 12:40
-
-
Save lewang/5da92a4f126a489c107ed494aa548caa to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from aqt.qt import * | |
import aqt | |
import anki | |
# enable only 1, 2 during review, disable "ENTER" to prevent speedup | |
def keyHandler(self, evt, _old): | |
key = unicode(evt.text()) | |
if evt.key() != Qt.Key_Return and key != "3" and key != "4": | |
return _old(self, evt) | |
aqt.reviewer.Reviewer._keyHandler = anki.hooks.wrap(aqt.reviewer.Reviewer._keyHandler, keyHandler, "around") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment