import pyatspi

reg = pyatspi.Registry

def callback(event):
        print "HERE", event
	event.consume = True
	return True

reg.registerDeviceEventListener(callback, 
                                [pyatspi.BUTTON_PRESSED_EVENT,
                                 pyatspi.BUTTON_RELEASED_EVENT])

reg.start()
