Choose the skin tone of an emoji from the keyboard - #31241
Open
rezabakhshilaktasaraei wants to merge 3 commits into
Open
Choose the skin tone of an emoji from the keyboard#31241rezabakhshilaktasaraei wants to merge 3 commits into
rezabakhshilaktasaraei wants to merge 3 commits into
Conversation
The emoji panel is a painted grid with no keyboard handling and nothing for a screen reader to read: opened from the keyboard, it appeared with no one to talk to, and pressing the "Emoji" button of a field seemed to do nothing. Expose every cell shown as an item of a list - named by the emoji itself, which the screen reader speaks in its own words, described by the section it is in (the category, or the title of a custom set); the last cell of a collapsed set is the "+N" that opens it. In screen reader mode the list takes the focus once the panel is shown and remembers where it came from; the arrows walk the cells (Up and Down by column, on into the next section), Home, End and the page keys too. Enter or Space chooses the emoji, Escape gives up - both return the focus to where it was and ask the panel to hide, which TabbedSelector::cancelled() passes on. A selection made from the keyboard survives the mouse leaving the list. SetFocus and Invoke from the screen reader work the same way. The "Emoji" toggle of a field gives the focus to its field before opening the panel: the fields of a box tell the target of a chosen emoji apart by the focus, which a toggle pressed from the keyboard held itself. With the mouse the field has it already.
The variants of an emoji - its skin tones - are picked from a small panel the mouse brings up over the emoji: right away on the first press of an emoji none of whose variants was ever chosen, and under the button held for a long press after that, while a click puts the emoji in with the tone chosen before. From the keyboard there was no way to it: the emoji went in with whatever tone it had. Enter and Space now do on an emoji with variants what the mouse does, with the same delay: the picker comes up right away for one never chosen from, under the key held for a long press otherwise, and the key let go before that chooses. The picker takes the focus, with the variant shown in the list selected; it is a list for a screen reader, named by the emoji, its items the variants. Left and Right, Home and End walk them, Enter or Space chooses - the tone is saved and the emoji goes in, as a click does, with the focus back where it came from and the panel done - and Escape backs out to the same emoji in the list. The picker is raised above the list rather than inside it, so the list gives the focus in it back the same way as its own, and keeps the emoji it was on when the picker hides.
An emoji with skin tones and one without sounded the same in the list; nothing said there was a picker to open. Report such an emoji as expandable - expanded while its picker is up - so the screen reader hears it as collapsed and offers to expand it, which opens the picker as Shift+Enter does; collapsing closes it. On Windows this needs the UIA ExpandCollapse pattern offered to expandable elements (Qt patch 0043).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On top of #31240 (the emoji panel walked with the keyboard). The skin-tone picker was mouse-only: it comes up right away on the first press of an emoji none of whose variants was ever chosen, and under the button held for a long press (500 ms) after that, while a click inserts with the chosen tone.
expandable(expandedwhile its picker is up) and dispatches the standardshowMenuaction to open or close it (Dispatch the showMenu action of an expandable painted item desktop-app/lib_ui#365). Platforms whose bridge surfaces the expandable state for list items announce it as collapsed and can open the picker through it; the Windows UIA bridge currently does that for tree items only.Nothing changes without a screen reader except that Enter/Space in the panel gain the mouse's long-press behaviour. Verified with NVDA.