nvaccess / nvda

NVDA, the free and open source Screen Reader for Microsoft Windows
Other
2.07k stars 624 forks source link

The input translation table option doesn't work for some braille displays #16642

Closed school510587 closed 1 month ago

school510587 commented 3 months ago

Steps to reproduce:

Case one:

  1. Open the braille panel of the preference settings.
  2. Set the input translation table to Unicode.
  3. Press the braille space key in an editable control.

Case two:

  1. Press NVDA+1, "input help on".
  2. Press space + dot 1 on the braille keyboard of Seika NoteTaker.

Actual behavior:

In the case one, an ordinary space character appears. In the case two, NVDA says "dot 1".

Expected behavior:

In the case one, a braille space () should appear. In the case two, NVDA should say "space with dot 1".

NVDA logs, crash dumps and other attachments:

None. This is an unreasonable behavior due to the implementation, rather than an exception.

System configuration

NVDA installed/portable/running from source:

Portable.

NVDA version:

2024.1

Windows version:

Windows 10 22H2 (10.0.19045) workstation AMD64

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

None.

Other information about your system:

None.

Other questions

Does the issue still occur after restarting your computer?

Yes.

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

No.

If NVDA add-ons are disabled, is your problem still occurring?

Yes.

Does the issue still occur after you run the COM Registration Fixing Tool in NVDA's tools menu?

Yes.

seanbudd commented 3 months ago

Can you please describe the use case? We have trouble understanding the problem you are trying to solve with this expected behaviour.

Adriani90 commented 3 months ago

The unicode braille input table should produce unicode braille characters when pressing the buttons on the braille display. These are unicode braille characters: https://www.unicode.org/charts/nameslist/n_2800.html

@LeonarddeR any idea why this does not work with some braille displays? Are there any displays which override the braille input table behavior of NVDA through their own driver or so?

school510587 commented 3 months ago

@seanbudd,

"Unicode braille" (unicode-braille.utb) is a suitable benchmark, but not a good use case.

I think "English (U.S.) grade 2" (en-us-g2.ctb) is a good use case. A problematic driver won't generate the correct grade 2 English text when the input translation table is set to "English (U.S.) grade 2."

school510587 commented 3 months ago

I have more discussion with the owners of these braille displays recently. A conclusion is that the expected behavior can be restored by unchecking "HID keyboard input simulation" option. However, it exists for EuroBraille driver, not for SeikaNT driver. The option defaults to True, but the owner didn't notice it.

school510587 commented 2 months ago

Hi all,

Sorry, I have editted the issue itself. After more discussion, it is sure that the driver of SeikaNT does not parse "space with dots" input correctly.

It must be better to edit the issue title, but the "Edit Issue title" button seens not to work.

Adriani90 commented 2 months ago

cc: @moyanming are you still available to look into this?

school510587 commented 2 months ago

In function _handleKeys() of seikantk.py:

        if brailleDots:
            gestures.append(InputGesture(dots=brailleDots))

Trivially, if the "space" parameter of InputGesture class is passed correctly, the problem will be solved.

I don't know whether the backspace (left space) is also a space here.

school510587 commented 2 months ago

Besides, in the constructor of InputGesture:

        elif dots is not None:
            self.dots = dots
            if space:
                self.space = space
                names.add(_keyNames[1])
            names.update(_getKeyNames(dots, _dotNames))

There may be a potential logical problem. "space" is represented by the other parameter, which may imply that the input of a single braille space won't pass "dots is not None". It will let the driver never generate any correct braille space input.

school510587 commented 2 months ago

Hi, I editted the main issue description again.

Now, the description is complete. It seens to be two problems, but I think they should be solved simultaneously.

Note that I don't encourage to reproduce the case one via the input help, because both the kb:space and bk:space are reported "space".