Last modified: 2014-04-26 16:25:25 UTC
Currently mw.util.updateTooltipAccessKeys only updates the tooltip, if it already ends with an access key in square brackets. While mw.util.addPortletLink takes care to provide the title in this format, there are other ocassions (like <input>s created by a script), where you currently have to add the access key explicitely to the title before you can call mw.util.updateTooltipAccessKeys. If the title doesn't end with something that looks like an access key, mw.util.updateTooltipAccessKeys should just add it, and IMHO do so even if there is no title at all. So $foo.append(mw.html.element('input', {id: 'myInput', accesskey: 'x', title: 'Something'})); mw.util.updateTooltipAccessKeys($('#myInput')); should work and update the title to "Something [alt-shift-x]" (or whatever).
If mw.util.updateTooltipAccessKeys were a generic utility to setup accesskey tooltips, then it should do this indeed. However at this point it was never intended to do that, so classifying this as an enhancement instead. The method is purely to update (not create) accesskey tooltips. Though this is not well documented right now, it is the responsibility of the creator of the element (either server-side code in Skin and Linker system or client-side code in mw.util.addPortletLink) to add a placeholder to the tooltip in form of " [x]".
Change 125426 had a related patch set uploaded by Umherirrender: Add jquery.accessKeyLabel javascript module https://gerrit.wikimedia.org/r/125426
Change 125426 merged by jenkins-bot: Add jquery.accessKeyLabel javascript module https://gerrit.wikimedia.org/r/125426