cursorManager module

Implementation of cursor managers. A cursor manager provides caret navigation and selection commands for a virtual text range.

class cursorManager.FindDialog(parent, cursorManager, text, caseSensitivity, reverse=False)

Bases: ContextHelpMixin, Dialog

A dialog used to specify text to find in a cursor manager.

helpId = 'SearchingForText'
onOk(evt)
onCancel(evt)
class cursorManager.CursorManager(*args, **kwargs)

Bases: TextContainerObject, ScriptableObject

A mix-in providing caret navigation and selection commands for the object’s virtual text range. This is required where a text range is not linked to a physical control and thus does not provide commands to move the cursor, select and copy text, etc. This base cursor manager requires that the text range being used stores its own caret and selection information.

This is a mix-in class; i.e. it should be inherited alongside another L{baseObject.ScriptableObject}. The class into which it is inherited must provide a C{makeTextInfo(position)} method.

@ivar selection: The current caret/selection range. @type selection: L{textInfos.TextInfo}

_focusEventMustUpdateCaretPosition = False
scriptCategory = 'Browse mode'
_lastFindText = ''
_lastCaseSensitivity = False
initOverlayClass()

Performs automatic initialisation if this is being used as an overlay class.

initCursorManager()

Initialise this cursor manager. This must be called before the cursor manager functionality can be used. It is normally called by L{__init__} or L{initOverlayClass}.

_get_selection()
_set_selection(info)
_caretMovementScriptHelper(gesture, unit, direction=None, posConstant='selection', posUnit=None, posUnitEnd=False, extraDetail=False, handleSymbols=False)
doFindText(text, reverse=False, caseSensitive=False, willSayAllResume=False)
script_find(gesture, reverse=False)

find a text string from the current cursor position

script_findNext(gesture)

find the next occurrence of the previously entered text string from the current cursor’s position

script_findPrevious(gesture)

find the previous occurrence of the previously entered text string from the current cursor’s position

script_moveByPage_back(gesture)
script_moveByPage_forward(gesture)
script_moveByCharacter_back(gesture)
script_moveByCharacter_forward(gesture)
script_moveByWord_back(gesture)
script_moveByWord_forward(gesture)
script_moveByLine_back(gesture)
script_moveByLine_forward(gesture)
script_moveBySentence_back(gesture)
script_moveBySentence_forward(gesture)
_handleParagraphNavigation(gesture: InputGesture, nextParagraph: bool) None
script_moveByParagraph_back(gesture: InputGesture)
script_moveByParagraph_forward(gesture: InputGesture)
script_startOfLine(gesture)
script_endOfLine(gesture)
script_topOfDocument(gesture)
script_bottomOfDocument(gesture)
_selectionMovementScriptHelper(unit=None, direction=None, toPosition=None)
script_selectCharacter_forward(gesture)
script_selectCharacter_back(gesture)
script_selectWord_forward(gesture)
script_selectWord_back(gesture)
script_selectLine_forward(gesture)
script_selectLine_back(gesture)
script_selectPage_forward(gesture)
script_selectPage_back(gesture)
script_selectParagraph_forward(gesture)
script_selectParagraph_back(gesture)
script_selectToBeginningOfLine(gesture)
script_selectToEndOfLine(gesture)
script_selectToTopOfDocument(gesture)
script_selectToBottomOfDocument(gesture)
script_selectAll(gesture)
_nativeAppSelectionModeSupported: bool = False

Whether native selection mode is available in this browse mode document

_nativeAppSelectionMode: bool = False

Whether native selection mode is turned on or off

script_copyToClipboard(gesture: InputGesture)
reportSelectionChange(oldTextInfo)
__gestures = {'kb:NVDA+Control+f': 'find', 'kb:NVDA+f3': 'findNext', 'kb:NVDA+shift+f3': 'findPrevious', 'kb:alt+downArrow': 'moveBySentence_forward', 'kb:alt+upArrow': 'moveBySentence_back', 'kb:control+a': 'selectAll', 'kb:control+c': 'copyToClipboard', 'kb:control+downArrow': 'moveByParagraph_forward', 'kb:control+end': 'bottomOfDocument', 'kb:control+home': 'topOfDocument', 'kb:control+leftArrow': 'moveByWord_back', 'kb:control+rightArrow': 'moveByWord_forward', 'kb:control+upArrow': 'moveByParagraph_back', 'kb:downArrow': 'moveByLine_forward', 'kb:end': 'endOfLine', 'kb:home': 'startOfLine', 'kb:leftArrow': 'moveByCharacter_back', 'kb:pageDown': 'moveByPage_forward', 'kb:pageUp': 'moveByPage_back', 'kb:rightArrow': 'moveByCharacter_forward', 'kb:shift+control+downArrow': 'selectParagraph_forward', 'kb:shift+control+end': 'selectToBottomOfDocument', 'kb:shift+control+home': 'selectToTopOfDocument', 'kb:shift+control+leftArrow': 'selectWord_back', 'kb:shift+control+rightArrow': 'selectWord_forward', 'kb:shift+control+upArrow': 'selectParagraph_back', 'kb:shift+downArrow': 'selectLine_forward', 'kb:shift+end': 'selectToEndOfLine', 'kb:shift+home': 'selectToBeginningOfLine', 'kb:shift+leftArrow': 'selectCharacter_back', 'kb:shift+pageDown': 'selectPage_forward', 'kb:shift+pageUp': 'selectPage_back', 'kb:shift+rightArrow': 'selectCharacter_forward', 'kb:shift+upArrow': 'selectLine_back', 'kb:upArrow': 'moveByLine_back'}
_abc_impl = <_abc._abc_data object>
property selection
class cursorManager._ReviewCursorManagerTextInfo(*args, **kwargs)

Bases: TextInfo

For use with L{ReviewCursorManager}. Overrides L{updateCaret} and L{updateSelection} to use the selection property on the underlying object.

Constructor. Subclasses must extend this, calling the superclass method first. @param position: The initial position of this range; one of the POSITION_* constants or a position object supported by the implementation. @param obj: The object containing the range of text being represented.

updateCaret()

Moves the system caret to the position of this text info object

updateSelection()

Moves the selection (usually the system caret) to the position of this text info object

_abc_impl = <_abc._abc_data object>
class cursorManager.ReviewCursorManager(*args, **kwargs)

Bases: CursorManager

A cursor manager used for review. This cursor manager maintains its own caret and selection information. Thus, the underlying text range need not support updating the caret or selection.

_focusEventMustUpdateCaretPosition = True
_abc_impl = <_abc._abc_data object>
initCursorManager()

Initialise this cursor manager. This must be called before the cursor manager functionality can be used. It is normally called by L{__init__} or L{initOverlayClass}.

_propertyCache: Set[GetterMethodT]
makeTextInfo(position)