Global keybinding on X using Python gtk3
问题 I was looking for some example of python xlib global keybinding that would work with gtk3, just as it is done for gtk2 at http://www.siafoo.net/snippet/239. Very similar code here: from Xlib.display import Display from Xlib import X import gtk.gdk import threading import gobject class GlobalKeyBinding (gobject.GObject, threading.Thread): __gsignals__ = { 'activate': (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, ()), } def __init__ (self): gobject.GObject.__init__ (self) threading.Thread.__init