Hint reveal on iOS gamepad?

I saw a post a while back asking if this was possible. Any plans to make this available?

Didn’t your notetype already provide Javascript to provide this via a shortcut key? If so, it should just be a matter of aliasing the function to a user action, and assigning that to one of the gamepad buttons.

https://docs.ankimobile.net/study-tools.html#actions

My official note types do. But other note types I use (like for language study) are just simple ones and I’ve used the built in hint option rather than try to do the complicated javascript

You’ll still need a custom function to do this, but it shouldn’t be too hard to make one that works with the standard hint fields. There’s an undocumented feature that can be used to add a script tag that applies to all of your notetypes, if you have a bunch of them and don’t want to update each one. Editing Anki CSS/html - #14 by hengiesel

1 Like

For anyone that finds this thread, @abdo wrote this script for note types which has worked really well

<script>
    /* User Action: Toggle hint fields */
    var userJs1 = () => {
        for (const link of document.querySelectorAll("a.hint")) {
            const hint = link.nextElementSibling;
            if (hint.style.display === "none") {
                link.style.display = "none";
                hint.style.display = "block";
            } else {
                link.style.display = "block";
                hint.style.display = "none";
            }
        }
    };
</script>
1 Like

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