NVDA with Japanese branch
Révision | 95164afb91bca1c64b062944ead1babf93d827b4 (tree) |
---|---|
l'heure | 2013-03-09 15:04:23 |
Auteur | James Teh <jamie@jant...> |
Commiter | James Teh |
hims driver: Support braille input.
Fixes #3028.
@@ -2,7 +2,7 @@ | ||
2 | 2 | #A part of NonVisual Desktop Access (NVDA) |
3 | 3 | #This file is covered by the GNU General Public License. |
4 | 4 | #See the file COPYING for more details. |
5 | -#Copyright (C) 2010-2012 Gianluca Casalino, NV Access Limited | |
5 | +#Copyright (C) 2010-2013 Gianluca Casalino, NV Access Limited | |
6 | 6 | |
7 | 7 | from logHandler import log |
8 | 8 | from ctypes import * |
@@ -11,6 +11,7 @@ import braille | ||
11 | 11 | import inputCore |
12 | 12 | from winUser import WNDCLASSEXW, WNDPROC, LRESULT, HCURSOR |
13 | 13 | import hwPortUtils |
14 | +from brailleInput import BrailleInputGesture | |
14 | 15 | |
15 | 16 | HIMS_KEYPRESSED = 0x01 |
16 | 17 | HIMS_KEYRELEASED = 0x02 |
@@ -59,6 +60,7 @@ HIMS_KEYS = { | ||
59 | 60 | 0x400000: 'Advance7', |
60 | 61 | 0x800000: 'Advance8' |
61 | 62 | } |
63 | +SPACE_KEY = 0x100 | |
62 | 64 | |
63 | 65 | pressedKeys = set() |
64 | 66 | _ignoreKeyPresses = False |
@@ -204,7 +206,7 @@ class BrailleDisplayDriver(braille.BrailleDisplayDriver): | ||
204 | 206 | } |
205 | 207 | }) |
206 | 208 | |
207 | -class InputGesture(braille.BrailleDisplayGesture): | |
209 | +class InputGesture(braille.BrailleDisplayGesture, BrailleInputGesture): | |
208 | 210 | source = BrailleDisplayDriver.name |
209 | 211 | def __init__(self, keys): |
210 | 212 | super(InputGesture, self).__init__() |
@@ -214,7 +216,18 @@ class InputGesture(braille.BrailleDisplayGesture): | ||
214 | 216 | return |
215 | 217 | self.keyCodes = set(keys) |
216 | 218 | names = set() |
219 | + isBrailleInput = True | |
217 | 220 | for value in self.keyCodes: |
221 | + if isBrailleInput: | |
222 | + if 0xff & value: | |
223 | + self.dots |= value | |
224 | + elif value == SPACE_KEY: | |
225 | + self.space = True | |
226 | + else: | |
227 | + # This is not braille input. | |
228 | + isBrailleInput = False | |
229 | + self.dots = 0 | |
230 | + self.space = False | |
218 | 231 | try: |
219 | 232 | name = HIMS_KEYS[value] |
220 | 233 | if isinstance(name, dict): |
@@ -1401,8 +1401,6 @@ Please see the display's documentation for descriptions of where these keys can | ||
1401 | 1401 | NVDA supports Braille Sense and Braille EDGE displays from [Hims http://www.hims-inc.com/] when connected via USB or bluetooth. |
1402 | 1402 | If connecting via USB, you will need to install the USB drivers from HIMS on your system. |
1403 | 1403 | |
1404 | -Braille input is not yet supported. | |
1405 | - | |
1406 | 1404 | Following are the key assignments for these displays with NVDA. |
1407 | 1405 | Please see the display's documentation for descriptions of where these keys can be found. |
1408 | 1406 | %kc:beginInclude |