Module inputCore :: Class InputGesture
[hide private]
[frames] | no frames]

Class InputGesture

source code

                   object --+    
                            |    
baseObject.AutoPropertyObject --+
                                |
                               InputGesture

A single gesture of input from the user. For example, this could be a key press on a keyboard or Braille display or a click of the mouse. At the very least, subclasses must implement _get_identifiers and _get_displayName.

Nested Classes [hide private]

Inherited from baseObject.AutoPropertyObject: __metaclass__

Instance Methods [hide private]
list or tuple of str
_get_identifiers(self)
The identifier(s) which will be used in input gesture maps to represent this gesture.
source code
 
_get_logIdentifier(self)
A single identifier which will be logged for this gesture.
source code
str
_get_displayName(self)
The name of this gesture as presented to the user.
source code
 
reportExtra(self)
Report any extra information about this gesture to the user.
source code
script function
_get_script(self)
The script bound to this input gesture.
source code
 
send(self)
Send this gesture to the operating system.
source code
baseObject.ScriptableObject
_get_scriptableObject(self)
An object which contains scripts specific to this gesture or type of gesture.
source code

Inherited from baseObject.AutoPropertyObject: __init__, invalidateCache

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Methods [hide private]

Inherited from baseObject.AutoPropertyObject: invalidateCaches

Class Variables [hide private]
  cachePropertiesByDefault = True
  shouldReportAsCommand = True
  SPEECHEFFECT_CANCEL = "cancel"
  SPEECHEFFECT_PAUSE = "pause"
  SPEECHEFFECT_RESUME = "resume"
  speechEffectWhenExecuted = "cancel"
  isModifier = False
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

_get_identifiers(self)

source code 

The identifier(s) which will be used in input gesture maps to represent this gesture. These identifiers will be looked up in order until a match is found. A single identifier should take the form: source:id where source is a few characters representing the source of this gesture and id is the specific gesture. If id consists of multiple items with indeterminate order, they should be separated by a + sign and they should be in Python set order. Also, the entire identifier should be in lower case. An example identifier is: kb(desktop):nvda+1 Subclasses must implement this method.

Returns: list or tuple of str
One or more identifiers which uniquely identify this gesture.

_get_logIdentifier(self)

source code 

A single identifier which will be logged for this gesture. This identifier should be usable in input gesture maps, but should be as readable as possible to the user. For example, it might sort key names in a particular order and it might contain mixed case. This is in contrast to identifiers, which must be normalized. The base implementation returns the first identifier from identifiers.

_get_displayName(self)

source code 

The name of this gesture as presented to the user. Subclasses must implement this method.

Returns: str
The display name.

reportExtra(self)

source code 

Report any extra information about this gesture to the user. This is called just after command gestures are reported. For example, it could be used to report toggle states.

_get_script(self)

source code 

The script bound to this input gesture.

Returns: script function
The script to be executed.

send(self)

source code 

Send this gesture to the operating system. This is not possible for all sources.

Raises:
  • NotImplementedError - If the source does not support sending of gestures.

_get_scriptableObject(self)

source code 

An object which contains scripts specific to this gesture or type of gesture. This object will be searched for scripts before any other object when handling this gesture.

Returns: baseObject.ScriptableObject
The gesture specific scriptable object or None if there is none.