#!/usr/bin/python

import pyatspi

def listener(e):
    print(e)

pyatspi.Registry.registerEventListener(listener,
    "object:state-changed:focused",
    "object:state-changed:selected",
    "object:selection-changed",
    "object:active-descendant-changed",
    "focus:")
pyatspi.Registry.start()
