Improve reporting keyboard layout changes#8401
Improve reporting keyboard layout changes#8401michaelDCurran merged 8 commits intonvaccess:masterfrom
Conversation
In particular, fixes the problem of reporting the same keyboard layout over and over, alternating between a message with and without language name. * Don't report if there is no change, typically on TSF profile (de)activation. * Query the keyboard layout when NVDA starts instead of starting without a value. The previous implementation caused the first layout change to always be announced, even if the old and new layouts were identical. * Don't allow the input method name (two placeholders separated by a hyphen) to be translatable. * Fix a log message. * Improve comments. * Add copyright header.
source/NVDAHelper.py
Outdated
| @@ -1,3 +1,9 @@ | |||
| #NVDAHelper.py | |||
| #A part of NonVisual Desktop Access (NVDA) | |||
| #Copyright (C) 2017-2018 NV Access Limited, Peter Vagner, Davy Kager | |||
There was a problem hiding this comment.
Thanks for adding the header, but I don't think 2017 is a very accurate guess here. Could you do a quick search with git blame and change this accordingly?
There was a problem hiding this comment.
I already know it's 2008, not sure why that got lost.
LeonarddeR
left a comment
There was a problem hiding this comment.
It is indeed hard to predict whether this works 100% as you intend it to work. Therefore, let's give it some time in next to let it prove itself.
|
This sounds as if it fixes #5545 as well. |
michaelDCurran
left a comment
There was a problem hiding this comment.
I have multiple layouts installed including Chinese, Japanese and English US. When I switch to say the japanese layout, the language is no longer announced which means I do not know it is Japanese. All it says when I switch is "Microsoft IME". This is similar for Chinese: All it says is "Microsoft Bopomofo". It used to say "Chinese Traditional (Taiwan) - Microsoft Bopomofo".
|
@michaelDCurran Sorry, this is fixed now. |
|
Hello. After this update, the NVDA does not tell you to switch the layout when you switch error occurs. |
|
INFO - main (11:31:16.726): |
|
@gdata1 The most recent commit should fix this. Please give that build a try or wait until it lands in next. |
Link to issue number:
Fixes #7383. Fixes #8419.
Summary of the issue:
If only one keyboard layout is available, NVDA still reports keyboard layout changes. This occurs most frequently when opening new windows. It appears that these notifications come from (de)activating a TSF profile. The chanes should have been ignored. A logic error caused them to be reported anyway.
The message would alternate between one with and one without the language name. For example:
Description of how this pull request fixes the issue:
This PR fixes the logic error. It also overhauls the code to return early if the old and new layouts are identical. NVDA now queries the active layout when it starts instead of comparing the first layout change to
Noneand then always reporting it. Finally, support for XP is removed from the TSF C++ code as requested by @LeonarddeR.Testing performed:
Tested by using the new code for 15-30 minutes and looking at all the notifications NVDA got and what it did with them. I used one layout. Extensive testing by people who actually use multiple layouts is still needed.
Known issues with pull request:
Even if there is only one layout and NVDA would therefore never report chanes, it still listens for them. This could be avoided by checking how many layouts are installed when NVDA starts. However, this means that NVDA has to be restarted after adding or removing a keyboard layout. I think that the small overhead of just listening to layout changes is the better choice.
Change log entry:
Bug fixes: