nvaccess / nvda

NVDA, the free and open source Screen Reader for Microsoft Windows
https://www.nvaccess.org/
Other
2.11k stars 637 forks source link

Add support for AltGr in keyboard shortcuts #10767

Open CyrilleB79 opened 4 years ago

CyrilleB79 commented 4 years ago

Feature request:

Add support for AltGr (right alt) in keyboard shortcuts. This will allow translators to fix several issues with keyboard layouts. See summary of discussion: https://github.com/nvaccess/nvda/issues/10767#issuecomment-832781405

An example problem:

Steps to reproduce:

Actual behavior:

When typing the '#' character, NVDA announces:

style Normal, niveau hiérarchique 10

i.e. "Normal style, level 10"

Expected behavior:

NVDA only announces the words that are typed, no formatting information.

Technical

In MS Word, typing AltGr+3 produces the '#' character. But typing Control+Alt+3 gives the style "Title 3" to the current paragraph. However NVDA does not makes a difference between control+alt and altGr. Even if you can often replace one combination by another, it is not always the case as described here. The same bug would happen with control+alt+2 and the AltGr+2 combination (~ character). However in this case, Word has also a bug that prevents to switch to 'Title 2' style. So the solution would be to be able to attribute control+alt+3 to the script_increaseDecreaseOutlineLevel but leave AltGr+3 unassigned, at least in the localized gesture.ini file. If however there is a way to do this in NVDA, let me know.

System configuration

NVDA installed/portable/running from source:

Installed

NVDA version:

2019.3rc3

Windows version:

Win 10 1809

Name and version of other software in use when reproducing the issue:

Word 2016

Other information about your system:

Other questions

Does the issue still occur after restarting your PC?

Yes

Have you tried any other versions of NVDA? If so, please report their behaviors.

NVDA 2019.2.1 also presents this bug. Probably other older version even if I did not test them.

CyrilleB79 commented 4 years ago

If I am not mistaken, the same issue should happen with German keyboard when typing '²' or '³'characters, the ones that can be typed with AltGr+2 and AltGr+3, not the 2 or 3 superscripted by MS Word formatting.

lukaszgo1 commented 4 years ago

What about assigning control+rightAlt+3 to none in the gestures for French? I haven't tested this, but I believe it should work.

CyrilleB79 commented 4 years ago

@lukaszgo1 Thanks for your answer. I have tried the 2 following things:

But none of them work. I cannot assign a shortcut with leftAlt, leftalt, rightAlt or rightalt. Do you succeed in doing this? Could you try so that I may know if I am doing something wrong on my side or not? Thanks.

Adriani90 commented 4 years ago

This seems to occur for all languages using alt grafic key. Also in german for example. It occurs only for the key strokes alt gr+1, alt gr+2 and alt gr+3. alt gr+8 for example does not have this issue. It is very strange that it reports formatting style, but not the character that has been added to the document. It seems like Word exposes the wrong information to the screen reader. If this is the case, then maybe this should be reported to Microsoft. cc: @feerrenrut

CyrilleB79 commented 4 years ago

The issue occurs only with altGr+1, 2 or 3 since only control+alt+1, 2 or 3 are title formatting commands in MS Word and vocalized as such. You can check in the log that pressing alt+control+3 in help mode is linked to a script:

Input help: gesture kb(desktop):alt+control+3, bound to script increaseDecreaseOutlineLevel on NVDAObjects.window.winword.WordDocument

On the contrary, alt+control+8 is not linked to any script.

This is not a bug of MS Word (except the special case of AltGr+2 in French layout). The issue comes from NVDA which is not able to distinguish AltGr from control+alt combination in gestures. Let me know however if I am wrong.

@lukaszgo1 did you try to create a gesture with rightAlt only (not any alt key) as you suggested previously?

lukaszgo1 commented 4 years ago

I've thried and I can confirm @CyrilleB79's findings - it is impossible to assign gestures to only left or only right ALT key. I haven't looked into the sources to check why yet.

CyrilleB79 commented 4 years ago

After more investigations, the status is that NVDA announces style and title level when typing a characters corresponding to altGr+1/2/3 keystroke if these key combinations are defined for current keyboard layout. I have found these combination in:

nvdaes commented 4 years ago

Hi Cyrille, I confirm this for Spanish:

2020-06-30 14:22 GMT+02:00, CyrilleB79 notifications@github.com:

After more investigations, the status is that NVDA announces style and title level when typing a characters corresponding to altGr+1/2/3 keystroke if these key combinations are defined for current keyboard layout.

I have found these combination in:

  • French (fr_fr) keyboard layout: AltGr+2 is ~ (dead key), AltGr+3 is #

  • German (de_de) keyboard layout: AltGr+2 is ² , AltGr+3 is ³

  • Spanish (es_es) keyboard layout: AltGr+1 is | , AlgGr+2 is @ and AlgGr+3 is #

However in these 3 cases, according to what I can find in corresponding gestures.ini files, it seems that only French version of MS Word has control+alt+1/2/3 shortcut to set corresponding title level.

German MS Word seems to use alt+1, alt+2, alt+3, alt+4 instead. German people (@Adriani90 ) can you confirm this?

Spanish MS Word seems to use control+shift+1, control+shift+2, control+shift+3. Spanish people (@nvdaes) can you confirm this?

If this is confirmed for German/Spanish, bounding control+alt+1/2/3 to None in the section [NVDAObjects.window.winword.WordDocument] of gesture.ini file should resolve the issue for these languages. It can be done in translation SVN repo without any impact on NVDA's code.

However, the problem remains for French (and maybe other languages) where MS Word's shortcut to set title level 1/2/3 is the same as English MS Word.

--

You are receiving this because you were mentioned.

Reply to this email directly or view it on GitHub:

https://github.com/nvaccess/nvda/issues/10767#issuecomment-651756849

CyrilleB79 commented 4 years ago
  • Now, the above three keystrokes are wrongly assigned in gestures.ini.

What do you mean?

On MS Word Spanish, if I am correct (but I cannot test it), the present situation is the following with MS Word Spanish and Spanish keyboard layout:

Is this correct? Thanks.

nvdaes commented 4 years ago

Yes, this is correct. Thank you.

Enviado desde mi iPhone

El 30 jun 2020, a las 16:47, CyrilleB79 notifications@github.com escribió:

 Now, the above three keystrokes are wrongly assigned in gestures.ini. What do you mean?

On MS Word Spanish, if I am correct (but I cannot test it), the present situation is the following with MS Word Spanish and Spanish keyboard layout:

control+shift+1, 2 and 3 set title level 1, 2 and 3 respectively and this is correctly announced by NVDA. Should be so thanks to the following line in section [NVDAObjects.window.winword.WordDocument] of gesture.ini: increaseDecreaseOutlineLevel = kb:control+shift+1, kb:control+shift+2, kb:control+shift+3 AltGr+1, 2 and 3 writes |, @ and # respectively. But NVDA wrongly announces style and title level when preforming these keystrokes. This could be avoided by modifing the following line in section [NVDAObjects.window.winword.WordDocument] in gestures.ini: now: None = kb:control+a, kb:control+b, kb:control+i, kb:control+u, kb:control+l, kb:control+r, kb:control+shift+n, "kb:control+shift+," after modification: None = kb:control+a, kb:control+b, kb:control+i, kb:control+u, kb:control+l, kb:control+r, kb:control+shift+n, "kb:control+shift+,", kb:control+alt+1, kb:control+alt+2, kb:control+alt+3 Is this correct? Thanks.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

nvdaes commented 4 years ago

@Cyrilleb79, will you take care of gesture.ini files, or do you prefer that I take care of the spanish one? Also, as far as I know, this can be sent from svn but also from NVDA repo, in this case as a pull request to be reviewed. What do you think about these alternatives for gestures? Should this be mentioned in changes for 20.-2?¿ Enviado desde mi iPhone

El 30 jun 2020, a las 17:13, nvdaes notifications@github.com escribió:

 Yes, this is correct. Thank you.

Enviado desde mi iPhone

El 30 jun 2020, a las 16:47, CyrilleB79 notifications@github.com escribió:

 Now, the above three keystrokes are wrongly assigned in gestures.ini. What do you mean?

On MS Word Spanish, if I am correct (but I cannot test it), the present situation is the following with MS Word Spanish and Spanish keyboard layout:

control+shift+1, 2 and 3 set title level 1, 2 and 3 respectively and this is correctly announced by NVDA. Should be so thanks to the following line in section [NVDAObjects.window.winword.WordDocument] of gesture.ini: increaseDecreaseOutlineLevel = kb:control+shift+1, kb:control+shift+2, kb:control+shift+3 AltGr+1, 2 and 3 writes |, @ and # respectively. But NVDA wrongly announces style and title level when preforming these keystrokes. This could be avoided by modifing the following line in section [NVDAObjects.window.winword.WordDocument] in gestures.ini: now: None = kb:control+a, kb:control+b, kb:control+i, kb:control+u, kb:control+l, kb:control+r, kb:control+shift+n, "kb:control+shift+," after modification: None = kb:control+a, kb:control+b, kb:control+i, kb:control+u, kb:control+l, kb:control+r, kb:control+shift+n, "kb:control+shift+,", kb:control+alt+1, kb:control+alt+2, kb:control+alt+3 Is this correct? Thanks.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe. — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

CyrilleB79 commented 4 years ago

@CyrilleB79, will you take care of gesture.ini files, or do you prefer that I take care of the spanish one?

I prefer that you or people of the Spanish translators/community take care of this since they can test it. Moreover, it allows to teach more people to know how to make such modifications. I am available for checking or helping if required.

Also, as far as I know, this can be sent from svn but also from NVDA repo, in this case as a pull request to be reviewed. What do you think about these alternatives for gestures?

No, only SVN is used in this case. At least, it is my own experience. I had tried a PR against NVDA repo in the past (#10162) but it was not accepted and SVN was finally recommanded (after investigation).

Should this be mentioned in changes for 20.-2?¿

Changes for locale are usually not mentioned. Feel free to confirm with NVAccess people if you think it would be worth mentioning it. An alternative may be to advertise such changes on local mailing lists or info channels when the new NVDA release is out.

nvdaes commented 4 years ago

OK. I attached a gestures.ini for issue #4478 years ago, so I think this bug in Spanish is produced since I didn't unbind control+alt+1, +2 and +3 gestures for Word documents. I tried to modify this in SRT repo, but I cannot find gestures.ini into es folder. For this reason, and since I'm not part of the translations team for Spanish, I prefer to request this to @nvda-es people respecting their work in SRT repo. /cc: @ivnc About mentioning this in changes for 2020.2, I think this maybe good since this makes NVDA to announce wrong information regardless of implementational questions, for instance regardless of the fact that this needs to be send via SRT. Some questions related to locales are reflected in What's new document, for example when braille tables for specific languages are included. @feerrenrut, could this be mentioned in bugfixes section? Thanks.

2020-07-01 0:49 GMT+02:00, CyrilleB79 notifications@github.com:

@CyrilleB79, will you take care of gesture.ini files, or do you prefer that I take care of the spanish one?

I prefer that you or people of the Spanish translators/community take care of this since they can test it. Moreover, it allows to teach more people to know how to make such modifications. I am available for checking or helping if required.

Also, as far as I know, this can be sent from svn but also from NVDA repo, in this case as a pull request to be reviewed. What do you think about these alternatives for gestures?

No, only SVN is used in this case. At least, it is my own experience. I had tried a PR against NVDA repo in the past (#10162) but it was not accepted and SVN was finally recommanded (after investigation).

Should this be mentioned in changes for 20.-2?¿

Changes for locale are usually not mentioned. Feel free to confirm with NVAccess people if you think it would be worth mentioning it.

An alternative may be to advertise such changes on local mailing lists or info channels when the new NVDA release is out.

--

You are receiving this because you were mentioned.

Reply to this email directly or view it on GitHub:

https://github.com/nvaccess/nvda/issues/10767#issuecomment-652086611

CyrilleB79 commented 4 years ago

I tried to modify this in SRT repo, but I cannot find gestures.ini into es folder.

If it is not present in SRT, you need to add it, copying it from NVDA last version. More details regarding gesture translation can be found on the following page where it is described: TranslatingGesture

I also plan to send a message to translation mailing list regarding this issue since other languages may be in the same situation as Spanish and German. However, we are close to translation freeze for 2020.2 now. @feerrenrut do you consider it is still time to make gesture translation for 2020.2 or is it already too late? (risk of introducing bugs lately) Just let me know. Thanks.

josephsl commented 4 years ago

Hi, as long as only gestures.ini file is concerned, then please do commit changes to translations workflow. Thanks.

nvdaes commented 4 years ago

Thank you. After your previous clarification I know this should be done from SRT. As tried to explain in my previous comment, since I wasn't able to find gestures.ini in SRT/es folder and I am not part of the translation team for Spanish repo, I think it's better that spanish translators take care of this. They are @nvda-es (with dash). I am @nvdaes (Noelia). I don't understand the reason of these further clarifications made by @Josephsl and you @CyrilleB79. Perhaps my previous message was not understood :) Thanks

2020-07-01 9:09 GMT+02:00, CyrilleB79 notifications@github.com:

I tried to modify this in SRT repo, but I cannot find gestures.ini into es folder.

If it is not present in SRT, you need to add it, copying it from NVDA last version. More details regarding gesture translation can be found on the following page where it is described: TranslatingGesture

I also plan to send a message to translation mailing list regarding this issue since other languages may be in the same situation as Spanish and German. However, we are close to translation freeze for 2020.2 now. @feerrenrut do you consider it is still time to make gesture translation for 2020.2 or is it already too late? (risk of introducing bugs lately) Just let me know. Thanks.

-- You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub: https://github.com/nvaccess/nvda/issues/10767#issuecomment-652235954

ivnc commented 4 years ago

In reply to mentions: I'm also unable to find gestures.ini within the SRT "es" folder. That file was last modified on Git six years ago when the workflow was presumably different from the current one. Anyway, I'm not involved in interface localization. I've sent a note to @quetzatl, among others, to let him fix this and post the comments he considers appropriate with regard to this issue.

Regards.

jmdaweb commented 4 years ago

Gestures.ini added to Assembla for spanish, galician and colombian spanish, as all of these languages may be affected by this issue. Hope nothing breaks on next automatic merge.

nvdaes commented 4 years ago

Thanks.

2020-07-01 12:38 GMT+02:00, Iván Novegil notifications@github.com:

In reply to mentions: I'm also unable to find gestures.ini within the SRT "es" folder. That file was last modified on Git six years ago when the workflow was presumably different from the current one. Anyway, I'm not involved in interface localization. I've sent a note to @quetzatl, among others, to let him fix this and post the comments he considers appropriate with regard to this issue.

Regards.

-- You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub: https://github.com/nvaccess/nvda/issues/10767#issuecomment-652340655

CyrilleB79 commented 4 years ago

@jmdaweb the gestures kb:control+alt+1, kb:control+alt+2, kb:control+alt+3 still need to be unbound, i.e. bound to None. Do you take care of this? Also tests need to be done to check if these modifications solve the issue and do not break style and title level announcement. And a last question before making these changes: is there a specific version of MS Word in Colombia and/or in Galicia where these shortcuts may differ from the Spanish ones?

ivnc commented 4 years ago

Regarding your last question, Colombian Spanish is a variant of Spanish. I don’t know if it’s pressent in Word, if yes, it is unprobable that keystrokes are different. The same for Galician, despite being recognized as an independent official language. Anyway, it could be a good idea to, if translations are correctly merged, invite people to test next Beta or RC and to try to reproduce this issue, or even publishing a download link of gestures.ini for manual patching and test.

Regards.

nvdaes commented 4 years ago

In case Colombian has the same keystrokes than Spanish, gestures.ini from es language without variant should be used by NVDA if gestures.ini is not added for es_co: https://raw.githubusercontent.com/nvaccess/nvda/master/source/inputCore.py Fixme if I'm wrong, @CyrilleB79:

2020-07-01 15:01 GMT+02:00, Iván Novegil notifications@github.com:

Regarding your last question, Colombian Spanish is a variant of Spanish. I don’t know if it’s pressent in Word, if yes, it is unprobable that keystrokes are different. The same for Galician, despite being recognized as an independent official language.

Anyway, it could be a good idea to, if translations are correctly merged, invite people to test next Beta or RC and to try to reproduce this issue, or even publishing a download link of gestures.ini for manual patching and test.

Regards.

--

You are receiving this because you were mentioned.

Reply to this email directly or view it on GitHub:

https://github.com/nvaccess/nvda/issues/10767#issuecomment-652403824

jmdaweb commented 4 years ago

@CyrilleB79 Yes. I have tested and commited the changes to srt for spanish.

CyrilleB79 commented 4 years ago

@nvdaes wrote:

In case Colombian has the same keystrokes than Spanish, gestures.ini from es language without variant should be used by NVDA if gestures.ini is not added for es_co: https://raw.githubusercontent.com/nvaccess/nvda/master/source/inputCore.py Fixme if I'm wrong, @CyrilleB79

Reading the code in inputCore.py, I agree with you Noelia, even if I haven't not tested anything. However, locale/es_CO/gesture.ini is already in nvaccess\nvda:master branch and also in NVDA2020.2beta2 (maybe for a long time). In other words, adding or modifying the gesture.ini file in SRT (assembla) makes this file added/modified in NVDA Github repo. But probably deleting this file does not cause deletion in NVDA Github repo. Thus, I would recommand to modify es_CO/gestures.ini as per es/gestures.ini, unless there should be a specific keystroke for es_CO. An other option would be to remove es_CO gesture file in NVDA repo (as done for de_CH), but I think this would require a PR... probably too late for 2020.2.

@jmdaweb could you modify es_CO gesture file as per es gesture file? Also gl one should be modified the same way. Thanks.

CyrilleB79 commented 4 years ago

@Adriani90 regarding German do you or any other German guy plan to modify/test it? Cc @bdorer, hozosch, @Robert-J-H.

nvdaes commented 4 years ago

Thanks for clarification. Imo, for future maintenance, unless es_CO contains different keystrokes, I would remove it if Colombian translator agrees, since in case something is added to es, it probably would need to be added also for Colombian Spanish, and this may cause issues and extra work, just an opinion since I've been mentioned here too.

2020-07-06 14:20 GMT+02:00, CyrilleB79 notifications@github.com:

@nvdaes wrote:

In case Colombian has the same keystrokes than Spanish, gestures.ini from es language without variant should be used by NVDA if gestures.ini is not added for es_co: https://raw.githubusercontent.com/nvaccess/nvda/master/source/inputCore.py Fixme if I'm wrong, @CyrilleB79

Reading the code in inputCore.py, I agree with you Noelia, even if I haven't not tested anything. However, locale/es_CO/gesture.ini is already in nvaccess\nvda:master branch and also in NVDA2020.2beta2 (maybe for a long time). In other words, adding or modifying the gesture.ini file in SRT (assembla) makes this file added/modified in NVDA Github repo. But probably deleting this file does not cause deletion in NVDA Github repo. Thus, I would recommand to modify es_CO/gestures.ini as per es/gestures.ini, unless there should be a specific keystroke for es_CO. An other option would be to remove es_CO gesture file in NVDA repo (as done for de_CH), but I think this would require a PR... probably too late for 2020.2.

@jmdaweb could you modify es_CO gesture file as per es gesture file? Also gl one should be modified the same way. Thanks.

-- You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub: https://github.com/nvaccess/nvda/issues/10767#issuecomment-654200001

ivnc commented 4 years ago

Update: the documented procedure for updating gestures.ini doesn't seem to work. although @jmdaweb reported that the file was updated to fix this, I can't see the change on this repository, when the theory says that that file should have been synced, at least, two times in its last version. CC @josephsl

Regards.

ivnc commented 4 years ago

Update: the documented procedure for updating gestures.ini doesn't seem to work. although @jmdaweb reported that the file was updated to fix this, I can't see the change on this repository, when the theory says that that file should have been synced, at least, two times in its last version. CC @josephsl

Regards.

Sorry, I was wrong, the correct file appeared at the beta branch. I was checking in master.

bdorer commented 3 years ago

Fixed this for German, thanks.

feerrenrut commented 3 years ago

There seems to be a lot of history here, and it looks like the cause was found (thanks to all involved). Could anybody summarize any outstanding issues? Does this need code changes, or only translation updates?

CyrilleB79 commented 3 years ago

Thanks @feerrenrut to pay attention to this issue. There has been a lot of comments regarding gesture.ini file localization. Sorry for these off-topic comments.

However, the initial issue remains and cannot be fixed just by localization tasks (gestures.ini modifications). The initial issue description is correct and you can re-read it.

The main points to keep in mind are

What is missing in NVDA's code

Today, NVDA does not allow to include AltGr key (aka right Alt key) in a gesture. This would however be needed for French localization to make the following bindings:

Let me know if something is still unclear to you.

feerrenrut commented 3 years ago

Ok, thanks @CyrilleB79 for this fantastic summary. Let's make this issue a feature request to "add support for AltGr in shortcuts", I'll update the title.

CyrilleB79 commented 3 years ago

Let's make this issue a feature request to "add support for AltGr in shortcuts", I'll update the title.

Well, this way, you are transforming an issue in feature... IMO the original issue was describing a bug in French environment anyway:

feerrenrut commented 3 years ago

Is there something we can do about those issues? Or only add support for altGr?

CyrilleB79 commented 3 years ago

Unless I missed something, only AltGr support can fix this issue.

feerrenrut commented 3 years ago

Ok, then I think this issue now describes the changes required.