Skip to content

Commit

Permalink
Correct internal gesture ID for Seika Notetaker (nvaccess#17047)
Browse files Browse the repository at this point in the history
Fixes issue 3 of nvaccess#16828 .

Summary of the issue:
The br(seikantk):XXX IDs of bk:space and bk:space+dots are incorrect. Although it has few influence to UX, it may bring trouble to add-on developers.

Description of user facing changes
There must be one option displayed when adding a new gesture in Input gestures dialog is about Seika Notetaker. Without this PR, the option is always backspace+dX, e.g. backspace+d1+d3+d4+d5. Now, backspace+d1+d3+d4+d5, d1+d3+d4+d5+space, and backspace+d1+d3+d4+d5+space are displayed correctly according to the actual space key(s) pressed by the user.

Description of development approach
Type of space parameter of class InputGesture becomes int. It may be 1(backspace), 2(space), or 3(both). The correct key name is obtained from _getKeyNames.
  • Loading branch information
school510587 authored Sep 19, 2024
1 parent 72b0006 commit 23caa79
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
12 changes: 6 additions & 6 deletions source/brailleDisplayDrivers/seikantk.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,13 +308,13 @@ def _handleKeys(self, arg: bytes):
gestures = []
if brailleDots:
if key in (1, 2, 3): # bk:space+dots
gestures.append(InputGesture(dots=brailleDots, space=key))
key = 0
gestures.append(InputGesture(dots=brailleDots, space=True))
else: # bk:dots
gestures.append(InputGesture(dots=brailleDots, space=False))
gestures.append(InputGesture(dots=brailleDots, space=0))
if key:
if key in (1, 2): # bk:space
gestures.append(InputGesture(dots=0, space=True))
gestures.append(InputGesture(dots=0, space=key))
else: # br(seikantk):XXX
gestures.append(InputGesture(keys=key))
for gesture in gestures:
Expand Down Expand Up @@ -391,7 +391,7 @@ def _getRoutingIndexes(routingKeyBytes: bytes) -> Set[int]:
class InputGesture(braille.BrailleDisplayGesture, brailleInput.BrailleInputGesture):
source = BrailleDisplayDriver.name

def __init__(self, keys=None, dots=None, space=False, routing=None):
def __init__(self, keys=None, dots=None, space=0, routing=None):
super(braille.BrailleDisplayGesture, self).__init__()
# see what thumb keys are pressed:
names = set()
Expand All @@ -400,8 +400,8 @@ def __init__(self, keys=None, dots=None, space=False, routing=None):
elif dots is not None:
self.dots = dots
if space:
self.space = space
names.add(_keyNames[1])
self.space = bool(space)
names.update(_getKeyNames(space, _keyNames))
names.update(_getKeyNames(dots, _dotNames))
elif routing is not None:
self.routingIndex = routing
Expand Down
2 changes: 2 additions & 0 deletions user_docs/en/changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ In order to use this feature, the application volume adjuster needs to be enable
* Improvements when editing in Microsoft PowerPoint:
* Caret reporting no longer breaks when text contains wide characters, such as emoji. (#17006 , @LeonarddeR)
* Character location reporting is now accurate (e.g. when pressing `NVDA+Delete`. (#9941, @LeonarddeR)
* When using the Seika Notetaker, space and space with dots gestures are now displayed correctly in the Input Gestures dialog. (#17047, @school510587)
* Configuration profiles:
* Braille is no longer dysfunctional when activating 'say all' with an associated configuration profile. (#17163, @LeonarddeR)
* Fixed an issue where certain settings were explicitly saved to the active configuration profile even when the value of that setting was equal to the value in the base configuration. (#17157, @leonarddeR)
Expand Down Expand Up @@ -72,6 +73,7 @@ As the Add-on Store base URL is now configurable directly within NVDA, no replac
* The following symbols in `appModules.soffice` have been renamed (#6915, @michaelweghorn):
* `SymphonyDocument.announceToolbarButtonToggle` to `SymphonyDocument.announceFormattingGestureChange`
* `SymphonyDocument.script_toggleTextAttribute` to `SymphonyDocument.script_changeTextFormatting`
* The `space` keyword argument for `brailleDisplayDrivers.seikantk.InputGesture` now expects an `int` rather than a `bool`. (#17047, @school510587)
* The `[upgrade]` configuration section including `[upgrade][newLaptopKeyboardLayout]` has been removed. (#17191)

#### Deprecations
Expand Down

0 comments on commit 23caa79

Please sign in to comment.