Create with your project with npx trgkanki-template-cli init case_insensitive_type_answer base
case_insensitive_type_answer
base
Also Clone Anki's source code like mentioned here
Here's the vscode code view of our addon (left) and Anki (right) side by side.
Your addon has full access to Anki's internal data and code. This means you can patch existing code in any way you want. This is both power and responsibilities. You can execute arbitary code on user's PC, but don't do any malicious things on the addon.
For example, my extension noctrlq
disables Ctrl+Q
hotkey for exiting Anki window. To do this we...
Ctrl+Q
hotkey for exiting. On qt/designer/main.ui
, there is such a code. It's written in Qt5 UI file, but anyway this code registers the hotkey. <action name="actionExit">
<property name="text">
<string>E&xit</string>
</property>
<property name="shortcut">
<string notr="true">Ctrl+Q</string>
</property>
</action>
<property name="shortcut">~~~</property>
translates to form.actionExit.setShortcut(QKeySequence("Ctrl+Q"))
.noctrlq
, runs following code to remove all shortcuts of actionExit
.mw.form.actionExit.setShortcuts([])
That's a case of noctrlq
. In a case of case_insensitive_type_answer
, we need to find what code to patch.