Skip to content

Fix cursor routing for the MDV Lilli display driver#7472

Merged
michaelDCurran merged 2 commits into
nvaccess:masterfrom
BabbageCom:i7469
Sep 5, 2017
Merged

Fix cursor routing for the MDV Lilli display driver#7472
michaelDCurran merged 2 commits into
nvaccess:masterfrom
BabbageCom:i7469

Conversation

@LeonarddeR

@LeonarddeR LeonarddeR commented Aug 3, 2017

Copy link
Copy Markdown
Collaborator

Link to issue number:

Fixes #7469

Summary of the issue:

For MDV Lilli displays, using a cursor routing key moves the cursor one position ahead of the actual cell it should be positioned.

Description of how this pull request fixes the issue:

The routing indexes started at 1, but they should be zero based. Subtracted an additional 1 in index calculation. Also, converted some decimal values to hexadecimal values to improve readability

Testing performed:

@dreinn tested this, see #7469 (comment)

… indexes for the MDV Lilli braille display driver
Comment thread source/brailleDisplayDrivers/lilli.py Outdated
pass
if not key: break
if (key <= 64) or ((key >= 257) and (key <= 296)):
if (key <= 0x40) or ((key >= 0x101) and (key <= 0x128)):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need parentheses around the comparisons.

Also, the second half could be written more compactly:
0x101 <= key <= 0x128
I find that a bit more readable. Also, this means you can remove all parentheses.

There is trailing whitespace here.

Comment thread source/brailleDisplayDrivers/lilli.py Outdated
if (key >= 257) and (key <= 296):
inputCore.manager.executeGesture(InputGesture(LILLI_KEYS[65],key-256))
elif (key <= 64):
if (key >= 0x101) and (key <= 0x128):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All three comments from above apply here as well.

inputCore.manager.executeGesture(InputGesture(LILLI_KEYS[65],key-256))
elif (key <= 64):
if (key >= 0x101) and (key <= 0x128):
inputCore.manager.executeGesture(InputGesture(LILLI_KEYS[65],key-0x101))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would replace 65 by a constant, e.g. LILLI_ROUTING.

elif (key <= 64):
if (key >= 0x101) and (key <= 0x128):
inputCore.manager.executeGesture(InputGesture(LILLI_KEYS[65],key-0x101))
elif (key <= 0x40):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Parentheses. Yes, being very picky. :)

@LeonarddeR

Copy link
Copy Markdown
Collaborator Author

@dkager: Are you willing to do these changes?

michaelDCurran added a commit that referenced this pull request Aug 21, 2017
@michaelDCurran michaelDCurran merged commit 27a6e85 into nvaccess:master Sep 5, 2017
@nvaccessAuto nvaccessAuto added this to the 2017.4 milestone Sep 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Braille Cursor routing bring to the next characther

4 participants