Functions¶
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Details¶
- Atspi.deregister_device_event_listener(listener, filter)¶
- Parameters:
listener (
Atspi.DeviceListener
) – a pointer to theAtspi.DeviceListener
for which device events are requested.
- Raises:
- Returns:
- Return type:
Removes a device event listener from the registry’s listener queue, ceasing notification of events of the specified type.
- Atspi.deregister_keystroke_listener(listener, key_set, modmask, event_types)¶
- Parameters:
listener (
Atspi.DeviceListener
) – a pointer to theAtspi.DeviceListener
for which keystroke events are requested.key_set ([
Atspi.KeyDefinition
] orNone
) – a pointer to theAtspi.KeyDefinition
array indicating which keystroke events are requested, orNone
to indicate that all keycodes and keyvals for the specified modifier set are to be included.modmask (
int
) – the key modifier mask for which this listener is to be ‘deregistered’ (of type #AtspiKeyMaskType).event_types (
int
) – an #AtspiKeyMaskType mask indicating which types of key events were requested (Atspi.KeyEventType.PRESSED
, etc.).
- Raises:
- Returns:
- Return type:
Removes a keystroke event listener from the registry’s listener queue, ceasing notification of events with modifiers matching modmask.
- Atspi.event_main()¶
Starts/enters the main event loop for the AT-SPI services.
NOTE: This method does not return control; it is exited via a call to
Atspi.Event.quit
from within an event handler.
- Atspi.event_quit()¶
Quits the last main event loop for the AT-SPI services, See:
Atspi.Event.main
- Atspi.exit()¶
- Returns:
0 if there were no leaks, otherwise other integer values.
- Return type:
Disconnects from #AtspiRegistry instances and releases any floating resources. Call only once at exit.
- Atspi.generate_keyboard_event(keyval, keystring, synth_type)¶
- Parameters:
keyval (
int
) – aint
indicating the keycode or keysym or modifier mask of the key event being synthesized.keystring (
str
orNone
) – an (optional) UTF-8 string which, if synth_type isAtspi.KeySynthType.STRING
, indicates a ‘composed’ keyboard input string being synthesized; this type of keyboard event synthesis does not emulate hardware keypresses but injects the string as though a composing input method (such as XIM) were used.synth_type (
Atspi.KeySynthType
) – anAtspi.KeySynthType
flag indicating whether keyval is to be interpreted as a keysym rather than a keycode (Atspi.KeySynthType.SYM
) or a string (Atspi.KeySynthType.STRING
) or a modifier mask (Atspi.KeySynthType.LOCKMODIFIERS
andAtspi.KeySynthType.UNLOCKMODIFIERS
), or whether to synthesizeAtspi.KeySynthType.PRESS
,Atspi.KeySynthType.RELEASE
, or both (Atspi.KeySynthType.PRESSRELEASE
).
- Raises:
- Returns:
- Return type:
Synthesizes a keyboard event (as if a hardware keyboard event occurred in the current UI context).
- Atspi.generate_mouse_event(x, y, name)¶
- Parameters:
- Raises:
- Returns:
- Return type:
Synthesizes a mouse event at a specific screen coordinate. Most AT clients should use the #AccessibleAction interface when tempted to generate mouse events, rather than this method. Event names: b1p = button 1 press; b2r = button 2 release; b3c = button 3 click; b2d = button 2 double-click; abs = absolute motion; rel = relative motion.
- Atspi.generate_mouse_event_async(x, y, name, callback, *callback_data)¶
- Parameters:
x (
int
) – aint
indicating the screen x coordinate of the mouse event.y (
int
) – aint
indicating the screen y coordinate of the mouse event.name (
str
) – a string indicating which mouse event to be synthesized (e.g. “b1p”, “b1c”, “b2r”, “rel”, “abs”).callback (
Atspi.GenerateMouseEventCB
orNone
) – a callback to be called when a reply is received. May beNone
.callback_data (
object
orNone
) – data to be passed to callback.
- Raises:
Like
Atspi.generate_mouse_event
, but asynchronous.
- Atspi.get_desktop(i)¶
- Parameters:
i (
int
) – aint
indicating which of the accessible desktops is to be returned.- Returns:
a pointer to the i-th virtual desktop’s
Atspi.Accessible
representation.- Return type:
Gets the virtual desktop indicated by index i. NOTE: currently multiple virtual desktops are not implemented; as a consequence, any i value different from 0 will not return a virtual desktop - instead it will return
None
.
- Atspi.get_desktop_count()¶
-
Gets the number of virtual desktops. NOTE: multiple virtual desktops are not implemented yet; as a consequence, this function always returns 1.
- Atspi.get_desktop_list()¶
- Returns:
a
GLib.Array
of desktops.- Return type:
Gets the list of virtual desktops. On return, list will point to a newly-created,
None
terminated array of virtual desktop pointers. It is the responsibility of the caller to free this array when it is no longer needed. NOTE: currently multiple virtual desktops are not implemented; this implementation always returns a #Garray with a singleAtspi.Accessible
desktop.
- Atspi.get_version()¶
- Returns:
- major:
the major version.
- minor:
the minor version.
- micro:
the micro/patch version.
- Return type:
Returns the version of the AT-SPI library being used at runtime.
New in version 2.50.
- Atspi.init()¶
- Returns:
0 on success, 1 if already initialized, or an integer error code.
- Return type:
Connects to the accessibility registry and initializes the SPI.
- Atspi.is_initialized()¶
- Returns:
%True if initialized; %False otherwise.
- Return type:
Indicates whether AT-SPI has been initialized.
- Atspi.register_device_event_listener(listener, event_types, filter)¶
- Parameters:
listener (
Atspi.DeviceListener
) –event_types (
int
) –
- Raises:
- Returns:
Always returns
False
.- Return type:
This function does nothing and should not be called.
- Atspi.register_keystroke_listener(listener, key_set, modmask, event_types, sync_type)¶
- Parameters:
listener (
Atspi.DeviceListener
) – a pointer to theAtspi.DeviceListener
for which keystroke events are requested.key_set ([
Atspi.KeyDefinition
] orNone
) – a pointer to theAtspi.KeyDefinition
array indicating which keystroke events are requested, orNone
to indicate that all keycodes and keyvals for the specified modifier set are to be included.modmask (
int
) – an #AtspiKeyMaskType mask indicating which key event modifiers must be set in combination with keys, events will only be reported for key events for which all modifiers in modmask are set. If you wish to listen for events with multiple modifier combinations, you must callAtspi.register_keystroke_listener
once for each combination.event_types (
int
) – an #AtspiKeyMaskType mask indicating which types of key events are requested (Atspi.KeyEventType.PRESSED
etc.).sync_type (
Atspi.KeyListenerSyncType
) – anAtspi.KeyListenerSyncType
parameter indicating the behavior of the notification/listener transaction.
- Raises:
- Returns:
- Return type:
Registers a listener for keystroke events, either pre-emptively for all windows (
Atspi.KeyListenerSyncType.ALL_WINDOWS
), non-preemptively (Atspi.KeyListenerSyncType.NOSYNC
), or pre-emptively at the toolkit level (Atspi.KeyListenerSyncType.CANCONSUME
). If ALL_WINDOWS or CANCONSUME are used, the event is consumed upon receipt if one of listener's callbacks returnsTrue
(other sync_type values may be available in the future).
- Atspi.role_get_localized_name(role)¶
- Parameters:
role (
Atspi.Role
) – anAtspi.Role
object to query.- Returns:
the localized string describing the
Atspi.Role
- Return type:
Gets the localized description string describing the
Atspi.Role
role.
- Atspi.role_get_name(role)¶
- Parameters:
role (
Atspi.Role
) – anAtspi.Role
object to query.- Returns:
a localizable string name for an
Atspi.Role
enumerated type.- Return type:
Gets a localizable string that indicates the name of an
Atspi.Role
.
- Atspi.set_main_context(cnx)¶
- Parameters:
cnx (
GLib.MainContext
) – TheGLib.MainContext
to use.
Sets the main loop context that AT-SPI should assume is in use when setting an idle callback. This function should be called by application-side implementors (ie, at-spi2-atk) when it is desirable to re-enter the main loop.
- Atspi.set_reference_window(accessible)¶
- Parameters:
accessible (
Atspi.Accessible
) – theAtspi.Accessible
corresponding to the window to select. should be a top-level window with a role ofAtspi.Role.APPLICATION
.
Deprecated. This function no longer does anything and should not be used.
- Atspi.set_timeout(val, startup_time)¶
- Parameters:
val (
int
) – The timeout value, in milliseconds, or -1 to disable the timeout.startup_time (
int
) – The amount of time, in milliseconds, to allow to pass before enforcing timeouts on an application. Can be used to prevent timeout exceptions if an application is likely to block for an extended period of time on initialization. -1 can be passed to disable this behavior.
Set the timeout used for method calls. If this is not set explicitly, a default of 800 ms is used. Note that at-spi2-registryd currently uses a timeout of 3 seconds when sending a keyboard event notification. This means that, if an AT makes a call in response to the keyboard notification and the application being called does not respond before the timeout is reached, at-spi2-registryd will time out on the keyboard event notification and pass the key onto the application (ie, reply to indicate that the key was not consumed), so this may make it undesirable to set a timeout larger than 3 seconds.
By default, the normal timeout is set to 800 ms, and the application startup timeout is set to 15 seconds.