Task :: Tools :: Input :: Input :: Class Input
[hide private]
[frames] | no frames]

Class Input

source code

    object --+    
             |    
Base.TaskTools --+
                 |
                Input

Provides methods for getting input on any AEInput device.

Instance Methods [hide private]
AEInput
getInputDevice(self, name=None, *capabilities)
Gets an AEOutput device from the DeviceManager given its name or its capabilities.
source code
 
addInputModifiers(self, dev, *codes)
Adds the given device code as a modifier on the named AEInput device.
source code
 
removeInputModifiers(self, dev, *codes)
Removes the given device code as a modifier on the named AEInput device.
source code
 
registerCommand(self, dev, task_ident, propagate, *codes)
Registers a Task in this Perk to be executed in response to an AEEvent indicating that the given action codes were input on the given AEInput device.
source code
 
unregisterCommand(self, dev, *codes)
Unregisters a Task set to execute in response to the given action codes on the given device from this Perk only.
source code

Inherited from Base.TaskTools: __init__, close, init, postClose, postExecute, preExecute, preInit

Inherited from Base.TaskTools (private): _changeDefaultOutput

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

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

getInputDevice(self, name=None, *capabilities)

source code 

Gets an AEOutput device from the DeviceManager given its name or its capabilities. The capabilities list may include strings naming AEInput interfaces ("braille" and/or "system input" at present).

If neither is specified, the first available output device in the DeviceManager is returned.

Parameters:
  • name (string) - Class (UIE) name of the AEInput device to get
  • capabilities (list of string) - Names of capabilities required on the device
Returns: AEInput
The named output device
Raises:

addInputModifiers(self, dev, *codes)

source code 

Adds the given device code as a modifier on the named AEInput device. If the device doesn't support modifiers, ignores the error since it's a non-critical operation.

Parameters:
  • dev (AEInput) - Reference to an input device
  • codes (integer) - Action codes to add as modifiers

removeInputModifiers(self, dev, *codes)

source code 

Removes the given device code as a modifier on the named AEInput device. If the device doesn't support modifiers, ignores the error since it's a non-critical operation.

Parameters:
  • dev (AEInput) - Reference to an input device
  • codes (integer) - Action codes to add as modifiers

registerCommand(self, dev, task_ident, propagate, *codes)

source code 

Registers a Task in this Perk to be executed in response to an AEEvent indicating that the given action codes were input on the given AEInput device.

Parameters:
  • dev (AEInput) - Device to monitor for input
  • task_ident (string) - Name of the Task registered via Task.Tools.System.System.registerTask to execute when the input gesture is detected on the device
  • propagate (boolean) - Should the input gesture be allowed to propagate to the OS after we receive it?
  • codes (list of list of integer) - List of lists of action codes forming the AEInput.Gesture that will trigger the execution of the named Task. For example, codes=[[Keyboard.AEK_CTRL, Keyboard.AEK_TILDE]] indicates the single gesture of simultaneously pressing Ctrl and ~ on the keyboard device.
Raises:
  • ValueError - When a Task with the given name is not registered
  • InvalidDeviceError - When a AEInput device with the given name is not registered

unregisterCommand(self, dev, *codes)

source code 

Unregisters a Task set to execute in response to the given action codes on the given device from this Perk only.

Parameters:
  • dev (AEInput) - Device to monitor for input
  • codes (list of list of integer) - List of lists of action codes forming the AEInput.Gesture that will trigger the execution of the named Task. For example, codes=[[Keyboard.AEK_CTRL, Keyboard.AEK_TILDE]] indicates the single gesture of simultaneously pressing Ctrl and ~ on the keyboard device.
Raises: