Skip to content

Instantly share code, notes, and snippets.

Created October 1, 2017 06:29
Show Gist options
  • Save anonymous/bcb42875ed2d98afb9e6afc87ce8a287 to your computer and use it in GitHub Desktop.
Save anonymous/bcb42875ed2d98afb9e6afc87ce8a287 to your computer and use it in GitHub Desktop.
example-gtk-keybinder.py
#!/usr/bin/env python
import gtk
import keybinder
def callback(keystr):
print "Handling", keystr
print "Event time:", keybinder.get_current_event_time()
if __name__ == '__main__':
keystr = "<Ctrl>A"
#Keybinder.init()
keybinder.bind(keystr, callback, "Keystring %s (user data)" % keystr)
print "Press", keystr, "to handle keybinding and quit"
gtk.main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment