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.
  • [get | view] (2021-02-25 09:44:42, 0.6 KB) [[attachment:pushbutton_event.py]]
  • [get | view] (2021-02-25 09:44:42, 1.0 KB) [[attachment:pushbutton_event.pyc]]
  • [get | view] (2021-02-25 09:44:42, 1.5 KB) [[attachment:selector_plugin.py]]
  • [get | view] (2021-02-25 09:44:42, 1.3 KB) [[attachment:selector_plugin.pyc]]
 All files | Selected Files: delete move to page copy to page

You are not allowed to attach a file to this page.