Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 2 additions & 71 deletions source/brailleDisplayDrivers/papenmeier.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@
import hwPortUtils
import serial

#for brxcom
import ctypes
import winreg

#for scripting
from baseObject import ScriptableObject
Expand Down Expand Up @@ -127,26 +124,6 @@ def check(cls):
"""should return false if there is a missing dependency"""
return True

def connectBrxCom(self):#connect to brxcom server (provided by papenmeier)
try:
with winreg.OpenKey(
winreg.HKEY_LOCAL_MACHINE,
r"SOFTWARE\FHP\BrxCom"
) as brxcomkey:
value, vtype = winreg.QueryValueEx(brxcomkey, "InstallPath")
assert vtype == winreg.REG_SZ # value is of type: str
self._brxnvda = ctypes.cdll.LoadLibrary(value + r"\brxnvda.dll")
if self._brxnvda.brxnvda_init(value + r"\BrxCom.dll"):
self._baud=1 #prevent bluetooth from connecting
self.numCells=self._brxnvda.brxnvda_numCells()
self._voffset=self._brxnvda.brxnvda_numVertCells()
log.info("Found Braille Display connected via BRXCom")
self.startTimer()
return None
except:
log.debugWarning("BRXCom is not installed")
self._brxnvda = None

def connectBluetooth(self):
"""try to connect to bluetooth device first, bluetooth is only supported on Braillex Trio"""
if(self._baud == 0 and self._dev is None):
Expand All @@ -162,7 +139,7 @@ def connectBluetooth(self):
log.debugWarning("connectBluetooth failed")

def connectUSB(self, devlist: List[bytes]):
"""try to connect to usb device,is triggered when BRXCOM is not installed and bluetooth
"""Try to connect to usb device, this is triggered when bluetooth
connection could not be established"""
try:
self._dev = ftdi2.open_ex(devlist[0])
Expand All @@ -183,8 +160,6 @@ def __init__(self):
self._dev = None
self._proto = None
devlist: List[bytes] = []
self.connectBrxCom()
if(self._baud == 1): return #brxcom is running, skip bluetooth and USB

#try to connect to usb device,
#if no usb device is found there may be a bluetooth device
Expand Down Expand Up @@ -348,16 +323,11 @@ def terminate(self):
self.stopTimer()
if(self._dev is not None): self._dev.close()
self._dev=None
if(self._brxnvda): self._brxnvda.brxnvda_close()
except:
self._dev=None

def display(self, cells: List[int]):
"""write to braille display"""
if(self._brxnvda):
newcells = bytes(cells)
self._brxnvda.brxnvda_sendToDisplay(newcells)
return
if(self._dev is None): return
try:
self._dev.write(brl_out(cells, self._nlk, self._nrk, self._voffset))
Expand All @@ -372,11 +342,6 @@ def executeGesture(self,gesture):
def _handleKeyPresses(self):
"""handles key presses and performs a gesture"""
try:
if(self._brxnvda):
k: int = self._brxnvda.brxnvda_keyIndex()
if(k!=-1):
self.executeGesture(InputGesture(k,self))
return
if(self._dev is None and self._baud>0):
try:
devlist: List[bytes] = ftdi2.list_devices()
Expand Down Expand Up @@ -551,24 +516,6 @@ def brl_join_keys(dec: List[str]) -> str:
elif(len(dec) == 2): return dec[1] + "," + dec[0]
else: return ''

def brl_keyname_decoded(key: int, rest: str) -> str:
"""convert index used by brxcom to keyname"""
if(key == 11 or key == 9): return 'l1' + rest
elif(key == 12 or key == 10): return 'l2' + rest
elif(key == 13 or key == 15): return 'r1' + rest
elif(key == 14 or key == 16): return 'r2' + rest

elif(key == 3): return 'up' + rest
elif(key == 7): return 'dn' + rest
elif(key == 1): return 'left' + rest
elif(key == 5): return 'right' + rest

elif(key == 4): return 'up2' + rest
elif(key == 8): return 'dn2' + rest
elif(key == 2): return 'left2' + rest
elif(key == 6): return 'right2' + rest
else: return ''


class InputGesture(braille.BrailleDisplayGesture, brailleInput.BrailleInputGesture):
"""Input gesture for papenmeier displays"""
Expand All @@ -583,7 +530,7 @@ def __init__(self, keys: Optional[Union[bytes, int]], driver: BrailleDisplayDriv
self.id=brl_join_keys(brl_decode_key_names_repeat(driver))
return

if driver._baud != 1 and keys[0] == ord(b'L'):
if keys[0] == ord(b'L'):
assert isinstance(keys, bytes)
if (keys[3] - 48) >> 3:
scancode = keys[5] - 48 << 4 | keys[6] - 48
Expand Down Expand Up @@ -613,22 +560,6 @@ def __init__(self, keys: Optional[Union[bytes, int]], driver: BrailleDisplayDriv
else:self.dots = dots
return

if(driver._baud==1):#brxcom
assert isinstance(keys, int)
if(keys>255 and keys<512):
self.routingIndex = keys-256-driver._voffset
self.id = "route"
return
elif(keys>511 and keys <786):
self.routingIndex = keys-512-driver._voffset
self.id="upperRouting"
return
else:
key1 = (keys & 0xFFFF0000) >> 16
key2 = keys & 0x0000FFFF
self.id=brl_keyname_decoded(key1, ',')+brl_keyname_decoded(key2, '')
return

if(driver._proto == 'A'):#non trio
assert isinstance(keys, bytes)
decodedkeys = brl_decode_keys_A(keys[3:], 4, driver._voffset*2)
Expand Down
2 changes: 1 addition & 1 deletion user_docs/de/userGuide.t2t
Original file line number Diff line number Diff line change
Expand Up @@ -3272,4 +3272,4 @@ Die folgenden Werte können geändert werden:
Wenn Sie weitere Informationen oder Hilfe bezüglich NVDA benötigen, besuchen Sie bitte die NVDA-Homepage unter NVDA_URL.
Neben Ressourcen der Community und dem technischen Support finden Sie auch zusätzliche Dokumentationen.
Auf diesen Seiten werden Informationen und Ressourcen zur NVDA-Entwicklung ebenfalls bereitgestellt.

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.

Please reintroduce this line - there should be no changes to the German documentation in this PR as it would introduce conflicts for translators.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Is it fine now?

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'm afraid it isn't. This should be just empty line not hyphen. Essentially when looking at the list of files modified by this PR German user guide should not be mentioned at all.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

So I restored it from nvaccess:master and it's gone from the "files changed" list!

-
4 changes: 0 additions & 4 deletions user_docs/en/userGuide.t2t
Original file line number Diff line number Diff line change
Expand Up @@ -2858,10 +2858,6 @@ The following Braille displays are supported:

These displays do not support NVDA's automatic background braille display detection functionality.

If BrxCom is installed, NVDA will use BrxCom.
BrxCom is a tool that allows keyboard input from the braille display to function independently from a screen reader.
Keyboard input is possible with the Trio and BRAILLEX Live models.

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.

Just to make sure - since you've removed this line are you saying that braille input is supported with other devices as well?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

BrxCom is a kind of connection chain. BrxCom connects to the braille display and the screenreader connects to BrxCom.
All keyboard inputs are handled by BrxCom and not passed through to the screenreader. NVDA is able to handle the qwerty and the braille input itself. Other screenreaders also implemented this function, so BrxCom is not needed anymore.


Most devices have an Easy Access Bar (EAB) that allows intuitive and fast operation.
The EAB can be moved in four directions where generally each direction has two switches.
The C and Live series are the only exceptions to this rule.
Expand Down