Functions

  deregister_device_event_listener (listener, filter)
  deregister_keystroke_listener (listener, key_set, modmask, event_types)
  event_main ()
  event_quit ()
  exit ()
  generate_keyboard_event (keyval, keystring, synth_type)
  generate_mouse_event (x, y, name)
  get_desktop (i)
  get_desktop_count ()
  get_desktop_list ()
  init ()
  is_initialized ()
  register_device_event_listener (listener, event_types, filter)
  register_keystroke_listener (listener, key_set, modmask, event_types, sync_type)
  role_get_name (role)
  set_main_context (cnx)
  set_reference_window (accessible)
  set_timeout (val, startup_time)

Details

Atspi.deregister_device_event_listener(listener, filter)
Parameters:
Raises:

GLib.Error

Returns:

True if successful, otherwise False.

Return type:

bool

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 the Atspi.DeviceListener for which keystroke events are requested.
  • key_set ([Atspi.KeyDefinition] or None) – a pointer to the Atspi.KeyDefinition array indicating which keystroke events are requested, or None 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:

GLib.Error

Returns:

True if successful, otherwise False.

Return type:

bool

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:int

Disconnects from #AtspiRegistry instances and releases any floating resources. Call only once at exit.

Atspi.generate_keyboard_event(keyval, keystring, synth_type)
Parameters:
Raises:

GLib.Error

Returns:

True if successful, otherwise False.

Return type:

bool

Synthesizes a keyboard event (as if a hardware keyboard event occurred in the current UI context).

Atspi.generate_mouse_event(x, y, name)
Parameters:
  • x (int) – a int indicating the screen x coordinate of the mouse event.
  • y (int) – a int 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”).
Raises:

GLib.Error

Returns:

True if successful, otherwise False.

Return type:

bool

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.get_desktop(i)
Parameters:i (int) – a int 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:Atspi.Accessible

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()
Returns:a int indicating the number of active virtual desktops.
Return type:int

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:[Atspi.Accessible]

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 single Atspi.Accessible desktop.

Atspi.init()
Returns:0 on success, 1 if already initialized, or an integer error code.
Return type:int

Connects to the accessibility registry and initializes the SPI.

Atspi.is_initialized()
Returns:%True if initialized; %False otherwise.
Return type:bool

Indicates whether AT-SPI has been initialized.

Atspi.register_device_event_listener(listener, event_types, filter)
Parameters:
Raises:

GLib.Error

Returns:

True if successful, otherwise False.

Return type:

bool

Registers a listener for device events, for instance button events.

Atspi.register_keystroke_listener(listener, key_set, modmask, event_types, sync_type)
Parameters:
Raises:

GLib.Error

Returns:

True if successful, otherwise False.

Return type:

bool

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 returns True (other sync_type values may be available in the future).

Atspi.role_get_name(role)
Parameters:role (Atspi.Role) – an Atspi.Role object to query.
Returns:a localizable string name for an Atspi.Role enumerated type.
Return type:str

Gets a localizable string that indicates the name of an Atspi.Role. <em>DEPRECATED.</em>

Atspi.set_main_context(cnx)
Parameters:cnx (GLib.MainContext) – The GLib.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) – the Atspi.Accessible corresponding to the window to select. should be a top-level window with a role of Atspi.Role.APPLICATION.

Sets the reference window that will be used when Atspi.generate_mouse_event is called. Coordinates will be assumed to be relative to this window. This is needed because, due to Wayland’s security model, it is not currently possible to retrieve global coordinates. If None is passed, then AT-SPI will use the window that has focus at the time that Atspi.generate_mouse_event is called.

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