Windows 11/input experience window: recognize IME interface (#14836)
Closes #14509
Summary of the issue:
NVDA does not recognize Windows 11 IME interface, or if it does, announces candidate items multiple times.
Description of user facing changes
NVDA will recognize and announce Windows 11 IME candidate items used when entering text in languages such as Chinese, Japanese, Korean, and other languages through use of input method editors (IME).
Description of development approach
Three changes to modern keyboard app module:
Recognize IME candidate UI and candidate items found in Windows 11.
Unlike Windows 10, Windows 11 adds an extra element to IME candidate window, therefore descend one more level when locating IME candidate items in app module version of UIA element selected event handler.
Veto UIA element selected event for IME candidate item in Windows 11 until a solution that allows focus and element selected events to cooperate when announcing IME candidate items.
For the third change, feedback from people speaking and typing Chinese, Japanese, and Korean would be helpful (this PR was based on Korean nput but could be expanded to cover Chinese, Japanese, and perhaps other languages in the future, either part of this pull request (unlikely) or in future PR's).
Commits:
* appModules/modern keyboard: recognize Windows 11 IME candidate items. Re #14509.
Windows 11 IME candiate's parent window has AutomationId of 'TEMPLATE_PART_CandidatePanel' and items underneath it wil be reocnigzed as IME candidate items.
* Modern keyboard/Windows 11 IME: recognize IME UI in Windows 11. Re #14509.
If UI Automation Id is 'TEMPLATE_PART_CandidatePanel' or 'IME_Prediction_Window' and role is either a list or a pop-up menu, reocgnize this as Windows 11 IME user interface.
* IME candidate item: do not allow UIA elemnet selected event in Windows 11.
Windows 11 raises focus event when IME candidate receives system focus, and without turning off element selected event, it will result in NVDA announcing candidate items twice. Therefore return early if IME candidate item raises element selected event while running Windows 11.
* IME/element selected: descend one more level when handling IME candidate item in Windows 11.
Unlike Windows 10, Windows 11 IME window adds an extra element when descending IME window hierarchy, therefore descend one more level to handle IME candidate item and UIA eement selected event coming from it.