Javascript prevent default hotkey?

Hi! This may be quite a niche topic, but anyways…

I’m creating a deck on recognizing musical intervals, and instead of adding tons of audio files to the deck, I’m generating sounds on the fly via Javascript.

My question is: is there any way to override Anki’s replay hotkey so that I can replay my Javascript audio by pressing “r”? (currently anki picks the hotkey up and tries to replay any audio files in the card, but obviously there are none and so it just prevents my JS from managing the keypress).

I could go about using another key that is not on anki’s hotkey list, but if there’s a way to do it it’d really be convenient for the end user if I could just fake the default Anki behavior so that it works the same as in any other deck.

1 Like