Looking for a little guidance on where/how an addon I'd like to develop should hook in

I have an add-on I would like to develop…it’s not terribly difficult: I want a hot-key that will immediately jump to the first deck with reviews. I’m pretty sure that I can figure this out pretty easily (though I welcome any pointers!!) once I figure out where in anki I should be integrating.

What I mean is, for an add-on that wants to do this, what is the right place to inject my own method? I apologize for asking such a basic question, but I imagine this will be very easy for the devs, and will probably spend me many many hours trying to figure out anki’s configuration. Knowing where to inject, I’m pretty sure I can figure out the rest (though again, I won’t say no to pointers ;).

Thank you very much, and thank you for anki!

There’s the hook main_window_did_init. Upon that you could do something like:

import aqt
from aqt.qt import *

QShortcut(QKeySequence("my+Key"), aqt.mw, my_function)

thank you very much! I can get started with this :slight_smile:

1 Like