Kenishi/Answer-Key-Cascade — pull request #1 by ospalh (2012-08-22 14:05:41+00:00)
Title: Rewrite

Hi.

I see the use of having all the keys 1 to 4 always answer the cards. But your way of doing it, patching mw.keyPressEvent, seems a bit odd to me.

To me, the right spot to fix this problem seems to be the Reviewer._answerCard(). As that is only called when you are in review mode, you don't have to worry if there is a button count at all and similar effects.

My solution is to simply reduce the number we pass on to Reviewer._answerCard() to the highest valid number when we call it with a too high number.

One more advantage, apart from the simplicity, is that this approach works with other add-ons that allow you to use other keys to answer the cards. (Like my [Dvorak keys](http://ospalh.github.com/anki-addons/Dvorak%20keys.html).)

This is basically a re-write. So, what shall we do? Do you want to publish this version? I am OK with that. Or should i? I have a collection of Anki 2 add-ons myself, where it would fit in, as well.