Atspi.Device¶
- Subclasses:
Methods¶
- Inherited:
- Structs:
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
|
|
|
|
|
|
|
|
|
|
|
Properties¶
None
Signals¶
- Inherited:
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent |
r |
Class Details¶
- class Atspi.Device(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
- classmethod new()¶
- Returns:
a pointer to a newly-created
Atspi.Device
.- Return type:
Creates a new
Atspi.Device
with a specified callback function.
- add_key_grab(kd, callback, *user_data)¶
- Parameters:
kd (
Atspi.KeyDefinition
) – aAtspi.KeyDefinition
specifying the key code to grab.callback (
Atspi.KeyCallback
orNone
) – the function to call when the given key is pressed.
- Returns:
an identifier that can be later used to remove the grab, or 0 if the key/modifier combination could not be grabbed. Add a key grab for the given key/modifier combination.
- Return type:
- add_key_watcher(*user_data)¶
-
Add a callback that will receive a notification whenever a key is pressed or released.
- generate_mouse_event(obj, x, y, name)¶
- Parameters:
obj (
Atspi.Accessible
) – TheAtspi.Accessible
that should receive the click.x (
int
) – aint
indicating the x coordinate of the mouse event, relative to obj..y (
int
) – aint
indicating the y coordinate of the mouse event, relative to obj..name (
str
) – a string indicating which mouse event to be synthesized (e.g. “b1p”, “b1c”, “b2r”, “rel”, “abs”).
- Raises:
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.
New in version 2.52.
- get_locked_modifiers()¶
-
Returns the locked modifiers (ie, num lock, caps lock) associated with this keyboard.
- get_modifier(keycode)¶
- Parameters:
keycode (
int
) – the keycode to map.- Returns:
the modifier that is mapped to this keycode.
- Return type:
Gets the modifier for a given keycode, if one exists. Does not create a new mapping. This function should be used when the intention is to query a locking modifier such as num lock via
Atspi.Device.get_locked_modifiers
, rather than to add key grabs.
- grab_keyboard()¶
-
Attempts to grab the entire keyboard. This should only be done temporarily, as it may conflict with other applications that also want to grab the keyboard.
- map_modifier(keycode)¶
- Parameters:
keycode (
int
) – the keycode to map.- Returns:
the modifier that is now mapped to this keycode. This return value can be passed to
Atspi.Device.add_key_grab
.- Return type:
Maps the specified key code to a modifier so that it can be used in conjunction with other keys to create a key grab. If the given keycode is already mapped, then this function will return the modifier that is currently mapped to the keycode, without doing anything else. Otherwise, it will use the last modifier that AT-SPI used to map a key. If no keys have yet been mapped using this device, then it will look for a modifier that is not currently being used. If no unused modifier can be found, then it will use the first modifier by default.
- notify_key(pressed, keycode, keysym, state, text)¶
- remove_key_grab(id)¶
- Parameters:
id (
int
) – the identifier of the grab to be removed.
Removes the key grab specified by id.
- ungrab_keyboard()¶
Removes a keyboard grab added via a call to atspi_device_add_keyboard.
- unmap_modifier(keycode)¶
- Parameters:
keycode (
int
) – the keycode to unmap.
Removes a mapped modifier from the given keycode.
- do_add_key_grab(kd) virtual¶
- Parameters:
kd (
Atspi.KeyDefinition
) –- Return type:
- do_generate_mouse_event(obj, x, y, name) virtual¶
- Parameters:
obj (
Atspi.Accessible
) – TheAtspi.Accessible
that should receive the click.x (
int
) – aint
indicating the x coordinate of the mouse event, relative to obj..y (
int
) – aint
indicating the y coordinate of the mouse event, relative to obj..name (
str
) – a string indicating which mouse event to be synthesized (e.g. “b1p”, “b1c”, “b2r”, “rel”, “abs”).
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.
New in version 2.52.
- do_get_locked_modifiers() virtual¶
-
Returns the locked modifiers (ie, num lock, caps lock) associated with this keyboard.
- do_get_modifier(keycode) virtual¶
- Parameters:
keycode (
int
) – the keycode to map.- Returns:
the modifier that is mapped to this keycode.
- Return type:
Gets the modifier for a given keycode, if one exists. Does not create a new mapping. This function should be used when the intention is to query a locking modifier such as num lock via
Atspi.Device.get_locked_modifiers
, rather than to add key grabs.
- do_grab_keyboard() virtual¶
-
Attempts to grab the entire keyboard. This should only be done temporarily, as it may conflict with other applications that also want to grab the keyboard.
- do_map_modifier(keycode) virtual¶
- Parameters:
keycode (
int
) – the keycode to map.- Returns:
the modifier that is now mapped to this keycode. This return value can be passed to
Atspi.Device.add_key_grab
.- Return type:
Maps the specified key code to a modifier so that it can be used in conjunction with other keys to create a key grab. If the given keycode is already mapped, then this function will return the modifier that is currently mapped to the keycode, without doing anything else. Otherwise, it will use the last modifier that AT-SPI used to map a key. If no keys have yet been mapped using this device, then it will look for a modifier that is not currently being used. If no unused modifier can be found, then it will use the first modifier by default.
- do_remove_key_grab(id) virtual¶
- Parameters:
id (
int
) – the identifier of the grab to be removed.
Removes the key grab specified by id.
- do_ungrab_keyboard() virtual¶
Removes a keyboard grab added via a call to atspi_device_add_keyboard.