Attachment 'pushbutton_event.py'
Download 1 from accerciser.plugin import ConsolePlugin
2 import pyatspi
3
4 class PushButtonFocus(ConsolePlugin):
5 plugin_name = 'Push Button Focus'
6 plugin_description = 'Print event when pushbutton get\'s focus.'
7
8 def init(self):
9 # Register a listener for the "focus" at-spi event.
10 pyatspi.Registry.registerEventListener(self.accEventFocusChanged,
11 'focus')
12
13 def accEventFocusChanged(self, event):
14 # If the even't source is a pushbutton, print it.
15 if event.source.getRole() == pyatspi.ROLE_PUSH_BUTTON:
16 self.appendText(str(event)+'\n')
Attached Files
To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.You are not allowed to attach a file to this page.