# Hint reveal on iOS gamepad?

**URL:** <https://forums.ankiweb.net/t/hint-reveal-on-ios-gamepad/30866>\
**Category:** Help\
**Created:** [June 3, 2023, 12:48pm UTC](https://forums.ankiweb.net/t/hint-reveal-on-ios-gamepad/30866 "2023-06-03T12:48:20Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![NickFlint](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/nickflint/32/35471_2.png) [@NickFlint](https://forums.ankiweb.net/u/NickFlint)\
**Post date:** [June 3, 2023, 12:48pm UTC](https://forums.ankiweb.net/t/hint-reveal-on-ios-gamepad/30866/1 "2023-06-03T12:48:21Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![dae](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/dae/32/65_2.png) [@dae](https://forums.ankiweb.net/u/dae)\
**Post date:** [June 5, 2023, 12:50am UTC](https://forums.ankiweb.net/t/hint-reveal-on-ios-gamepad/30866/2 "2023-06-05T00:50:11Z")

</div>

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](https://docs.ankimobile.net/study-tools.html#actions)

---

<div class="post-metadata">

**Author:** ![NickFlint](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/nickflint/32/35471_2.png) [@NickFlint](https://forums.ankiweb.net/u/NickFlint)\
**Post date:** [June 5, 2023, 1:05am UTC](https://forums.ankiweb.net/t/hint-reveal-on-ios-gamepad/30866/3 "2023-06-05T01:05:16Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![dae](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/dae/32/65_2.png) [@dae](https://forums.ankiweb.net/u/dae)\
**Post date:** [June 5, 2023, 1:37am UTC](https://forums.ankiweb.net/t/hint-reveal-on-ios-gamepad/30866/4 "2023-06-05T01:37:43Z")

</div>

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](https://forums.ankiweb.net/t/editing-anki-css-html/7480/14)

---

<div class="post-metadata">

**Author:** ![NickFlint](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/nickflint/32/35471_2.png) [@NickFlint](https://forums.ankiweb.net/u/NickFlint)\
**Post date:** [June 11, 2023, 7:22pm UTC](https://forums.ankiweb.net/t/hint-reveal-on-ios-gamepad/30866/5 "2023-06-11T19:22:13Z")

</div>

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

```auto
<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>

```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/1X/8f1279ababc5879d54e4838989f606cfe55af8c7.jpeg) [@system](https://forums.ankiweb.net/u/system)\
**Post date:** [July 11, 2023, 7:22pm UTC](https://forums.ankiweb.net/t/hint-reveal-on-ios-gamepad/30866/6 "2023-07-11T19:22:21Z")

</div>

Closed on July 11, 2023, 7:22pm UTC

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