Where to find the definition of `reviewStateShortcuts` in the source code?

I have noticed some people use reviewStateShortcuts to map keys in the add-ons they write. For example:

I wanted to see the definition of reviewStateShortcut in the Anki source code. I used grep to search reviewStateShortcuts, but I found 0 matches. See code block below.

$ rm -rf /tmp/anki \
  && git clone --branch main --depth 1 'https://github.com/ankitects/anki' /tmp/anki \
  && grep -R 'reviewStateShortcuts' /tmp/anki | wc -l
0
$ cd /tmp/anki \
  && git log -S 'reviewStateShortcuts' | wc -l
0

My question is: Where can I find the definition of reviewStateShortcuts?

While I appreciate that some of you might explain what reviewStateShortcuts does, I’m more interested in finding its definition in the source code so that I can inspect it by myself and thus find out more information on how to properly use it.

1 Like

It’s a legacy hook called here:

Use the state_shortcuts_will_change hook in new code:

4 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.