Module keyboardHandler :: Class KeyboardInputGesture
[hide private]
[frames] | no frames]

Class KeyboardInputGesture

source code

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

A key pressed on the traditional system keyboard.

Nested Classes [hide private]

Inherited from baseObject.AutoPropertyObject: __metaclass__

Instance Methods [hide private]
 
__init__(self, modifiers, vkCode, scanCode, isExtended)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
_get_isNVDAModifierKey(self) source code
 
_get_isModifier(self) source code
 
_get_mainKeyName(self) source code
 
_get_modifierNames(self) source code
 
_get__keyNamesInDisplayOrder(self) 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
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_shouldReportAsCommand(self) source code
 
_get_speechEffectWhenExecuted(self) source code
 
reportExtra(self)
Report any extra information about this gesture to the user.
source code
 
_reportToggleKey(self) source code
 
send(self)
Send this gesture to the operating system.
source code

Inherited from baseObject.AutoPropertyObject: invalidateCache

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

Class Methods [hide private]
 
getVkName(cls, vkCode, isExtended) source code
KeyboardInputGesture
fromName(cls, name)
Create an instance given a key name.
source code

Inherited from baseObject.AutoPropertyObject: invalidateCaches

Class Variables [hide private]
  NORMAL_MODIFIER_KEYS = {winUser.VK_LCONTROL: winUser.VK_CONTRO...
  TOGGLE_KEYS = frozenset((winUser.VK_CAPITAL, winUser.VK_NUMLOC...
  LAYOUTS = {"desktop": _("desktop"), "laptop": _("laptop"),}

Inherited from inputCore.InputGesture: SPEECHEFFECT_CANCEL, SPEECHEFFECT_PAUSE, SPEECHEFFECT_RESUME, cachePropertiesByDefault, isModifier, shouldReportAsCommand, speechEffectWhenExecuted

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, modifiers, vkCode, scanCode, isExtended)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

_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.

Overrides: inputCore.InputGesture._get_logIdentifier
(inherited documentation)

_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.
Overrides: inputCore.InputGesture._get_displayName
(inherited documentation)

_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.
Overrides: inputCore.InputGesture._get_identifiers
(inherited documentation)

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.

Overrides: inputCore.InputGesture.reportExtra
(inherited documentation)

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.
Overrides: inputCore.InputGesture.send
(inherited documentation)

fromName(cls, name)
Class Method

source code 

Create an instance given a key name.

Parameters:
  • name (str) - The key name.
Returns: KeyboardInputGesture
A gesture for the specified key.

Class Variable Details [hide private]

NORMAL_MODIFIER_KEYS

Value:
{winUser.VK_LCONTROL: winUser.VK_CONTROL, winUser.VK_RCONTROL: winUser\
.VK_CONTROL, winUser.VK_LSHIFT: winUser.VK_SHIFT, winUser.VK_RSHIFT: w\
inUser.VK_SHIFT, winUser.VK_LMENU: winUser.VK_MENU, winUser.VK_RMENU: \
winUser.VK_MENU, winUser.VK_LWIN: VK_WIN, winUser.VK_RWIN: VK_WIN,}

TOGGLE_KEYS

Value:
frozenset((winUser.VK_CAPITAL, winUser.VK_NUMLOCK, winUser.VK_SCROLL))