Skip to content

Commit 5527eaa

Browse files
authored
Merge cc1d8f3 into 74987f3
2 parents 74987f3 + cc1d8f3 commit 5527eaa

2 files changed

Lines changed: 28 additions & 9 deletions

File tree

source/brailleDisplayDrivers/hims.py

Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,25 @@ def _get_keys(self):
116116
})
117117
return keys
118118

119+
120+
class BrailleEdge2S(BrailleEdge):
121+
"""This device is the BrailleEdge which doesn't use the hims driver.
122+
It only uses a SPP connection.
123+
"""
124+
usbId = "VID_1A86&PID_55D3"
125+
126+
def _get_keys(self) -> dict[str, str]:
127+
keys = Model._get_keys(self)
128+
129+
keys.update({
130+
0x01 << 16: "leftSideScrollUp",
131+
0x02 << 16: "rightSideScrollUp",
132+
0x04 << 16: "rightSideScrollDown",
133+
0x08 << 16: "leftSideScrollDown",
134+
})
135+
return keys
136+
137+
119138
class BrailleSense2S(BrailleSense):
120139
"""Braille Sense with one scroll key on both sides.
121140
Also referred to as Braille Sense Classic."""
@@ -171,6 +190,7 @@ def _get_keys(self):
171190
BrailleSenseQX,
172191
BrailleSenseQ,
173192
BrailleEdge,
193+
BrailleEdge2S,
174194
SmartBeetle,
175195
BrailleSense4S,
176196
BrailleSense2S,
@@ -196,6 +216,7 @@ def registerAutomaticDetection(cls, driverRegistrar: bdDetect.DriverRegistrar):
196216
# Sync Braille, serial device
197217
driverRegistrar.addUsbDevices(bdDetect.DeviceType.SERIAL, {
198218
"VID_0403&PID_6001",
219+
"VID_1A86&PID_55D3", # Braille Edge2S 40
199220
})
200221

201222
driverRegistrar.addBluetoothDevices(lambda m: any(m.id.startswith(prefix) for prefix in (
@@ -265,23 +286,20 @@ def _sendCellCountRequest(self):
265286

266287
def _sendIdentificationRequests(self, match: bdDetect.DeviceMatch):
267288
log.debug("Considering sending identification requests for device %s"%str(match))
268-
if match.type == bdDetect.DeviceType.CUSTOM: # USB Bulk
289+
if "bluetoothName" in match.deviceInfo: # Bluetooth
269290
matchedModelsMap = [
270291
modelTuple for modelTuple in modelMap if(
271-
modelTuple[1].usbId == match.id
292+
modelTuple[1].bluetoothPrefix
293+
and match.id.startswith(modelTuple[1].bluetoothPrefix)
272294
)
273295
]
274-
elif "bluetoothName" in match.deviceInfo: # Bluetooth
296+
else: # USB Bulk, Serial
275297
matchedModelsMap = [
276298
modelTuple for modelTuple in modelMap if(
277-
modelTuple[1].bluetoothPrefix
278-
and match.id.startswith(modelTuple[1].bluetoothPrefix)
299+
modelTuple[1].usbId == match.id
279300
)
280301
]
281-
else: # The only serial device we support which is not bluetooth, is a Sync Braille
282-
self._model = SyncBraille()
283-
log.debug("Use %s as model without sending an additional identification request"%self._model.name)
284-
return
302+
285303
if not matchedModelsMap:
286304
log.debugWarning("The provided device match to send identification requests didn't yield any results")
287305
matchedModelsMap = modelMap

user_docs/en/changes.t2t

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ What's New in NVDA
77

88
== New Features ==
99
- In Windows 11, NVDA will announce alerts from voice typing and suggested actions including the top suggestion when copying data such as phone numbers to the clipboard (Windows 11 2022 Update and later). (#16009, @josephsl)
10+
- Added support for the BrailleEdgeS2 braille device. (#16033)
1011
-
1112

1213

0 commit comments

Comments
 (0)