After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 666870 - Keystroke listeners only work if there is also an event listener
Keystroke listeners only work if there is also an event listener
Status: RESOLVED FIXED
Product: at-spi
Classification: Platform
Component: at-spi2-core
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Li Yuan
Depends on:
Blocks:
 
 
Reported: 2011-12-26 17:38 UTC by Joanmarie Diggs (IRC: joanie)
Modified: 2012-01-05 21:03 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Joanmarie Diggs (IRC: joanie) 2011-12-26 17:38:12 UTC
import pyatspi

def onObject(event):
    pass

def onKey(event):
    print "onKey: %s" % event

masks = range(0,256)
pyatspi.Registry.registerKeystrokeListener(onKey, mask=masks)
#If you comment out the next line, keystrokes will no longer be printed
pyatspi.Registry.registerEventListener(onObject, 'object:')
pyatspi.Registry.start()
Comment 1 Mike Gorse 2011-12-27 15:03:56 UTC
Looks like a side-effect of the "don't do anything if nothing is listening" change; we're incorrectly deregistering the keystroke listener when there are no event listeners, assuming that "nothing is listening." Right now, atk-bridge doesn't know if any key listeners are listening, and I don't think that we want to have the listener always be on, so we need to have at-spi2-registryd communicate when there are listeners active.
Comment 2 Mike Gorse 2012-01-05 21:03:44 UTC
Should be fixed with latest at-spi2-core and at-spi2-atk.