if info.copyToClipboard():\r
speech.speakMessage(_("copied to clipboard"))\r
\r
+ __gestures = {\r
+ "kb:pageUp": "pageUp",\r
+ "kb:pageDown": "pageDown",\r
+ "kb:upArrow": "moveByLine_back",\r
+ "kb:downArrow": "moveByLine_forward",\r
+ "kb:leftArrow": "moveByCharacter_back",\r
+ "kb:rightArrow": "moveByCharacter_forward",\r
+ "kb:control+leftArrow": "moveByWord_back",\r
+ "kb:control+rightArrow": "moveByWord_forward",\r
+ "kb:control+upArrow": "moveByParagraph_back",\r
+ "kb:control+downArrow": "moveByParagraph_forward",\r
+ "kb:home": "startOfLine",\r
+ "kb:end": "endOfLine",\r
+ "kb:control+home": "topOfDocument",\r
+ "kb:control+end": "bottomOfDocument",\r
+ "kb:shift+rightArrow": "selectCharacter_forward",\r
+ "kb:shift+leftArrow": "selectCharacter_back",\r
+ "kb:shift+control+rightArrow": "selectWord_forward",\r
+ "kb:shift+control+leftArrow": "selectWord_back",\r
+ "kb:shift+downArrow": "selectLine_forward",\r
+ "kb:shift+upArrow": "selectLine_back",\r
+ "kb:shift+end": "selectToEndOfLine",\r
+ "kb:shift+home": "selectToBeginningOfLine",\r
+ "kb:shift+control+end": "selectToBottomOfDocument",\r
+ "kb:shift+control+home": "selectToTopOfDocument",\r
+ "kb:control+a": "selectAll",\r
+ "kb:control+c": "copyToClipboard",\r
+ "kb:NVDA+Control+f": "find",\r
+ "kb:NVDA+f3": "findNext",\r
+ "kb:NVDA+shift+f3": "findPrevious",\r
+ }\r
+\r
def bindToStandardKeys(self):\r
"""Bind the standard navigation, selection and copy keys to the cursor manager scripts.\r
"""\r
- for keyName, scriptName in (\r
- ("extendedPrior","pageUp"),\r
- ("extendedNext","pageDown"),\r
- ("ExtendedUp","moveByLine_back"),\r
- ("ExtendedDown","moveByLine_forward"),\r
- ("ExtendedLeft","moveByCharacter_back"),\r
- ("ExtendedRight","moveByCharacter_forward"),\r
- ("Control+ExtendedLeft","moveByWord_back"),\r
- ("Control+ExtendedRight","moveByWord_forward"),\r
- ("Control+ExtendedUp","moveByParagraph_back"),\r
- ("Control+ExtendedDown","moveByParagraph_forward"),\r
- ("ExtendedHome","startOfLine"),\r
- ("ExtendedEnd","endOfLine"),\r
- ("control+ExtendedHome","topOfDocument"),\r
- ("control+ExtendedEnd","bottomOfDocument"),\r
- ("shift+extendedRight","selectCharacter_forward"),\r
- ("shift+extendedLeft","selectCharacter_back"),\r
- ("control+shift+extendedRight","selectWord_forward"),\r
- ("control+shift+extendedLeft","selectWord_back"),\r
- ("shift+extendedDown","selectLine_forward"),\r
- ("shift+extendedUp","selectLine_back"),\r
- ("shift+extendedEnd","selectToEndOfLine"),\r
- ("shift+extendedHome","selectToBeginningOfLine"),\r
- ("control+shift+extendedEnd","selectToBottomOfDocument"),\r
- ("control+shift+extendedHome","selectToTopOfDocument"),\r
- ("control+a","selectAll"),\r
- ("control+c","copyToClipboard"),\r
- ("NVDA+Control+f","find"),\r
- ("NVDA+f3","findNext"),\r
- ("NVDA+shift+f3","findPrevious"),\r
- ):\r
- self.bindKey_runtime(keyName, scriptName)\r
+ self.bindGestures(self.__gestures)\r
\r
class _ReviewCursorManagerTextInfo(textInfos.TextInfo):\r
"""For use with L{ReviewCursorManager}.\r
self._lastFocusObj = None\r
self._hadFirstGainFocus = False\r
self._lastProgrammaticScrollTime = None\r
+ self.bindGestures(self.__gestures)\r
self.loadBuffer()\r
\r
def terminate(self):\r
script.__doc__ = nextDoc\r
script.__name__ = funcName\r
setattr(cls, funcName, script)\r
- cls.bindKey(key, scriptName)\r
+ cls.__gestures["kb:%s" % key] = scriptName\r
scriptName = "previous%s" % scriptSuffix\r
funcName = "script_%s" % scriptName\r
script = lambda self,gesture: self._quickNavScript(gesture, nodeType, "previous", prevError, readUnit)\r
script.__doc__ = prevDoc\r
script.__name__ = funcName\r
setattr(cls, funcName, script)\r
- cls.bindKey("shift+%s" % key, scriptName)\r
+ cls.__gestures["kb:shift+%s" % key] = scriptName\r
\r
def script_elementsList(self,gesture):\r
if self.VBufHandle is None:\r
"""\r
return False\r
\r
-[VirtualBuffer.bindKey(keyName,scriptName) for keyName,scriptName in (\r
- ("Return","activatePosition"),\r
- ("Space","activatePosition"),\r
- ("NVDA+f5","refreshBuffer"),\r
- ("NVDA+v","toggleScreenLayout"),\r
- ("NVDA+f7","elementsList"),\r
- ("escape","disablePassThrough"),\r
- ("alt+extendedUp","collapseOrExpandControl"),\r
- ("alt+extendedDown","collapseOrExpandControl"),\r
- ("tab", "tab"),\r
- ("shift+tab", "shiftTab"),\r
- ("control+alt+extendedDown", "nextRow"),\r
- ("control+alt+extendedUp", "previousRow"),\r
- ("control+alt+extendedRight", "nextColumn"),\r
- ("control+alt+extendedLeft", "previousColumn"),\r
-)]\r
+ __gestures = {\r
+ "kb:enter": "activatePosition",\r
+ "kb:space": "activatePosition",\r
+ "kb:NVDA+f5": "refreshBuffer",\r
+ "kb:NVDA+v": "toggleScreenLayout",\r
+ "kb:NVDA+f7": "elementsList",\r
+ "kb:escape": "disablePassThrough",\r
+ "kb:alt+upArrow": "collapseOrExpandControl",\r
+ "kb:alt+downArrow": "collapseOrExpandControl",\r
+ "kb:tab": "tab",\r
+ "kb:shift+tab": "shiftTab",\r
+ "kb:control+alt+downArrow": "nextRow",\r
+ "kb:control+alt+upArrow": "previousRow",\r
+ "kb:control+alt+rightArrow": "nextColumn",\r
+ "kb:control+alt+leftArrow": "previousColumn",\r
+ }\r
\r
# Add quick navigation scripts.\r
qn = VirtualBuffer.addQuickNav\r