Fix cursor routing for the MDV Lilli display driver#7472
Merged
Conversation
… indexes for the MDV Lilli braille display driver
dkager
suggested changes
Aug 9, 2017
| pass | ||
| if not key: break | ||
| if (key <= 64) or ((key >= 257) and (key <= 296)): | ||
| if (key <= 0x40) or ((key >= 0x101) and (key <= 0x128)): |
Contributor
There was a problem hiding this comment.
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.
| if (key >= 257) and (key <= 296): | ||
| inputCore.manager.executeGesture(InputGesture(LILLI_KEYS[65],key-256)) | ||
| elif (key <= 64): | ||
| if (key >= 0x101) and (key <= 0x128): |
Contributor
There was a problem hiding this comment.
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)) |
Contributor
There was a problem hiding this comment.
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): |
Contributor
There was a problem hiding this comment.
Parentheses. Yes, being very picky. :)
Collaborator
Author
|
@dkager: Are you willing to do these changes? |
dkager
approved these changes
Aug 21, 2017
michaelDCurran
approved these changes
Aug 21, 2017
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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)