New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for uncontracted and contracted braille input. #6449

Merged
merged 29 commits into from Jul 7, 2017

Conversation

Projects
None yet
5 participants
@jcsteh
Contributor

jcsteh commented Oct 11, 2016

Beyond the main code in brailleInput to support uncontracted/contracted input, this includes the following changes:

  • The list of braille tables has been moved out of the braille module into a separate brailleTables module. Braille tables are now added with a function rather than directly adding them to the data structure. Aside from being necessary in order to specify and check whether a table is contracted, this also makes the data about tables more extensible in future.
  • As the data structure for braille tables has now changed and is no longer ordered, this was a good opportunity to sort the list of tables alphabetically when displaying them to the user.
  • brailleInput is now notified when reverting config or changing config profiles. This is necessary because brailleInput now maintains some state when the input table is changed.
  • brailleInput is now initialised before braille at startup. This is because braille depends on brailleInput to get the currently untranslated input.
  • Dot7 and dot8 are now universally bound to braille input specific scripts for erase and enter. Any braille display drivers that had bindings for backspace/enter for braille input have been adjusted accordingly.
  • In the User Guide, a "Braille" section has been added above "Application Specific Features". The "Braille Control Types and States" section has been moved to a sub-section of this, and a sub-section on Braille Input has been added.

Fixes #2439. Fixes #6054. Fixes #6113. Fixes #6935.

What's New entries:

In New Features:

- You can now type in both contracted and uncontracted braille on a braille display with a braille keyboard. See the Braille Input section of the User Guide for details. (#2439, #6054)

In Changes:

- The output and input table lists in the Braille Settings dialog are now sorted alphabetically. (#6113)
- Updated liblouis braille translator to 3.2.0. (#6935)
Support for uncontracted and contracted braille input.
Beyond the main code in brailleInput to support uncontracted/contracted input, this includes the following changes:
* The list of braille tables has been moved out of the braille module into a separate brailleTables module. Braille tables are now added with a function rather than directly adding them to the data structure. Aside from being necessary in order to specify and check whether a table is contracted, this also makes the data about tables more extensible in future.
* As the data structure for braille tables has now changed and is no longer ordered, this was a good opportunity to sort the list of tables alphabetically when displaying them to the user.
* brailleInput is now notified when reverting config or changing config profiles. This is necessary because brailleInput now maintains some state when the input table is changed.
* brailleInput is now initialised before braille at startup. This is because braille depends on brailleInput to get the currently untranslated input.
* Dot7 and dot8 are now universally bound to braille input specific scripts for erase and enter. Any braille display drivers that had bindings for backspace/enter for braille input have been adjusted accordingly.
@jcsteh

This comment has been minimized.

Show comment
Hide comment
@jcsteh

jcsteh Oct 11, 2016

Contributor

@feerrenrut, would you mind reviewing this please? Note that I've tried to explain some of the more obscure changes in the description of this pull request.

Contributor

jcsteh commented Oct 11, 2016

@feerrenrut, would you mind reviewing this please? Note that I've tried to explain some of the more obscure changes in the description of this pull request.

Show outdated Hide outdated source/braille.py
Show outdated Hide outdated source/braille.py
Show outdated Hide outdated source/braille.py
Show outdated Hide outdated source/braille.py
@@ -270,10 +270,10 @@ def display(self, cells):
"kb:end": ("br(braillenote):space+d4+d5",),
"kb:control+home": ("br(braillenote):space+d1+d2+d3",),
"kb:control+end": ("br(braillenote):space+d4+d5+d6",),
"kb:enter": ("br(braillenote):space+d8",),
"braille_enter": ("br(braillenote):space+d8",),

This comment has been minimized.

@feerrenrut

feerrenrut Oct 11, 2016

Contributor

I'm assuming this change is a new line conversion?

@feerrenrut

feerrenrut Oct 11, 2016

Contributor

I'm assuming this change is a new line conversion?

This comment has been minimized.

@jcsteh

jcsteh Oct 11, 2016

Contributor

Weird. This doesn't even show up in diffs from command line git. I reckon this is a GitHub bogus thingy. :(

@jcsteh

jcsteh Oct 11, 2016

Contributor

Weird. This doesn't even show up in diffs from command line git. I reckon this is a GitHub bogus thingy. :(

Show outdated Hide outdated source/globalCommands.py
Show outdated Hide outdated source/gui/settingsDialogs.py
Show outdated Hide outdated source/speech.py
Show outdated Hide outdated source/speech.py
Show outdated Hide outdated source/speech.py

jcsteh added some commits Oct 11, 2016

brailleInput: Fix exceptions when typing a single cell, pressing spac…
…e, typing two cells then pressing backspace.

This occurred because cellsWithText was being updated even for the space at the end of a word. At this point, we're starting a new word, so cellsWithText needs to be empty.
@jcsteh

This comment has been minimized.

Show comment
Hide comment
@jcsteh

jcsteh Oct 12, 2016

Contributor

@feerrenrut, I'm done with this batch of changes. I addressed your code review comments plus some other stuff noted below. Would you mind taking a look again?

@derekriemer reported a bug to me via IRC. STR:

  1. Enable input with UEB grade 2.
  2. Type "b" and press space.
  3. Press dot 6 twice.
  4. Press backspace.

This causes an exception. I've fixed this in 0b643d6.

I've also addressed a couple of other issues @derekriemer reported in recent comments on #2439.

Contributor

jcsteh commented Oct 12, 2016

@feerrenrut, I'm done with this batch of changes. I addressed your code review comments plus some other stuff noted below. Would you mind taking a look again?

@derekriemer reported a bug to me via IRC. STR:

  1. Enable input with UEB grade 2.
  2. Type "b" and press space.
  3. Press dot 6 twice.
  4. Press backspace.

This causes an exception. I've fixed this in 0b643d6.

I've also addressed a couple of other issues @derekriemer reported in recent comments on #2439.

@jcsteh

This comment has been minimized.

Show comment
Hide comment
@jcsteh

jcsteh Oct 12, 2016

Contributor

@feerrenrut, I'm done with this batch of changes.

Actually, I just pushed one more commit to mask characters in protected fields (e.g. password fields). Thanks @derekriemer for catching!

Contributor

jcsteh commented Oct 12, 2016

@feerrenrut, I'm done with this batch of changes.

Actually, I just pushed one more commit to mask characters in protected fields (e.g. password fields). Thanks @derekriemer for catching!

jcsteh added a commit that referenced this pull request Oct 13, 2016

@nvaccessAuto nvaccessAuto assigned jcsteh and unassigned feerrenrut Oct 13, 2016

jcsteh added some commits Oct 17, 2016

Update to a temporary NV Access branch of liblouis which incorporates…
… several pending upstream changes related to braille input.
Add the Unicode braille input table.
This necessitated the ability to have tables specific to either output or input, rather than assuming all tables can handle both.
Use new liblouis modes to improve back-translation:
* Always set noUndefinedDots so undefined dots (such as indicators that mean nothing by themselves) don't get translated to, for example, "\456/" for dots 4 5 6.
* Set partialTrans when reporting contracted cells, thus avoiding the "zz" hack which was breaking French where z is actually a contraction.
@jcsteh

This comment has been minimized.

Show comment
Hide comment
@jcsteh

jcsteh Nov 3, 2016

Contributor

Holding this back from the 2016.4 release, as there are some major outstanding issues:

  • Investigate/fix effect of undefined dots on subsequent translation. For example, with UEB g2, ⠰⠁⠃ gets translated to "about" instead of "ab" with noUndefinedDots. Without that mode, you get "\56/ab".
  • When there is untranslated input, routing braille outside of the untranslated input should clear the untranslated input.
  • Further UEB back-translation fixes from APH.
Contributor

jcsteh commented Nov 3, 2016

Holding this back from the 2016.4 release, as there are some major outstanding issues:

  • Investigate/fix effect of undefined dots on subsequent translation. For example, with UEB g2, ⠰⠁⠃ gets translated to "about" instead of "ab" with noUndefinedDots. Without that mode, you get "\56/ab".
  • When there is untranslated input, routing braille outside of the untranslated input should clear the untranslated input.
  • Further UEB back-translation fixes from APH.

@jcsteh jcsteh referenced this pull request Mar 20, 2017

Closed

Upgrade to Liblouis 3.2.0 #6935

jcsteh added some commits Jun 16, 2017

Fix keyboardHandler's treatment of Unicode characters sent by SendInp…
…ut (such as used by brailleInput).

These get sent with a vk code of VK_PACKET and need to be handled specially. Otherwise, we get very strange results because we're trying to treat the scan code as a real keyboard scan code.

jcsteh added some commits Jun 19, 2017

brailleInput: Handle renamed tables like we do for braille output, wh…
…ich doesn't apply now but might in future. Don't cause a startup failure if configured input table is invalid.
@josephsl

This comment has been minimized.

Show comment
Hide comment
@josephsl

josephsl Jun 19, 2017

Collaborator

Hi,

In Liblouis 3.2.0, Greek table name has changed from gr-gr-g1.utb to el.ctb. Thanks.

Collaborator

josephsl commented Jun 19, 2017

Hi,

In Liblouis 3.2.0, Greek table name has changed from gr-gr-g1.utb to el.ctb. Thanks.

@jcsteh jcsteh requested a review from feerrenrut Jun 19, 2017

brailleTables: Update for rename of Greek table in liblouis 3.2.0. Al…
…so, remove "grade 1" from the description, since there's no other grade.
@jcsteh

This comment has been minimized.

Show comment
Hide comment
@jcsteh

jcsteh Jun 19, 2017

Contributor

@feerrenrut, this is finally ready for another round of review. There have been a lot of changes and quite a long time since you last reviewed it, so you may want to just review from scratch. In case it's helpful, though, the changes since your last review are 5ff07e5b..ff6f627a.

Contributor

jcsteh commented Jun 19, 2017

@feerrenrut, this is finally ready for another round of review. There have been a lot of changes and quite a long time since you last reviewed it, so you may want to just review from scratch. In case it's helpful, though, the changes since your last review are 5ff07e5b..ff6f627a.

Show outdated Hide outdated source/brailleTables.py
Show outdated Hide outdated source/speech.py

@jcsteh jcsteh requested a review from feerrenrut Jun 20, 2017

BrailleInputGesture: Don't use Python set order for gesture identifie…
…rs; we got rid of that in #6962. Make it possible to get the display text from a braille keyboard gesture identifier (as used in the Input Gestures dialog).

@jcsteh jcsteh requested a review from feerrenrut Jun 21, 2017

@jcsteh

This comment has been minimized.

Show comment
Hide comment
@jcsteh

jcsteh Jun 21, 2017

Contributor

@feerrenrut, can you please review the latest commit? Sorry. :(

Contributor

jcsteh commented Jun 21, 2017

@feerrenrut, can you please review the latest commit? Sorry. :(

return self._makeDisplayText(self.dots, self.space)
@classmethod
def getDisplayTextForIdentifier(cls, identifier):

This comment has been minimized.

@feerrenrut

feerrenrut Jun 21, 2017

Contributor

Where is this called?

@feerrenrut

feerrenrut Jun 21, 2017

Contributor

Where is this called?

This comment has been minimized.

@feerrenrut

feerrenrut Jun 21, 2017

Contributor

Perhaps a docstring on this to explain what its for? Also, it would be nice to see a couple of examples of what identifier might be.

@feerrenrut

feerrenrut Jun 21, 2017

Contributor

Perhaps a docstring on this to explain what its for? Also, it would be nice to see a couple of examples of what identifier might be.

jcsteh added a commit that referenced this pull request Jun 22, 2017

@derekriemer

This comment has been minimized.

Show comment
Hide comment
@derekriemer

derekriemer Jun 28, 2017

Collaborator

fixes #6956

Collaborator

derekriemer commented Jun 28, 2017

fixes #6956

@derekriemer

This comment has been minimized.

Show comment
Hide comment
@derekriemer

derekriemer Jul 8, 2017

Collaborator

I'm amazed at how many tickets this autoclosed. What a huge chunk of work.

Collaborator

derekriemer commented Jul 8, 2017

I'm amazed at how many tickets this autoclosed. What a huge chunk of work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment