Windows 11 IME: announce visible candidates when the IME interface opens (#16541)
Closes #14023
Summary of the issue:
NVDA does not announce visible IME candidates in Windows 11.
Description of user facing changes
NVDA wil once again announce visible IME candidates when Windows 11 modern IME interface opens.
Description of development approach
Modern keyboard app module changes:
IME candidate UI lass: handle focus entered evdent, announcing visible candidates when IME interface opens.
IME candidate item: move Windows 11/Automation Id check to the end of the element selected event handler just before self.reportFocus() call so visible candidates can be anounced when switching between IME pages.
Commits:
* Windows 11 modern IME/element selected: move the Windows veriosn nad Automation Id check to end of the event handler. Re #14023.
When modern IME interface opens, NVDA does not report visible IME candidates, caused by element selected event returning early if running on Windows 11, checking for Automation Id, and to avoid gain focus event/repetitions. To allow reporting of IME candidates, move Windows 11 and Automatoin Id checks to just before reportFocus call so visible IME candidates can be announced. This, together with the next commit (focus entered event), allows NVDA to announce IME candidates in Windows 11.
* Modern IME interface: handle focus entered event to announce visible candidates. Re #14023.
Prior to IME candidate receiving gain focus event, focus entered event is received by IME interface. This gives it a chance to ask IME candidate to perform its element selected event, hopefully announcing visible candidates. However, candiate item's element selected event handler's navigator objec check occurs, and because navigator object is indeed the focused candidate item, visible candidates are not announced. Therefore, announce visible candidates (if told to do so) from focus entered event.
* Changelog: add Windows 11 IME interface bug fix entry. Re #14023
* Changelog: reorganize Windows 11 fixes entries including #14023.
* Modern keyboard/Flake8 E303: remove one extra blank line