Created
October 1, 2017 06:29
-
-
Save anonymous/bcb42875ed2d98afb9e6afc87ce8a287 to your computer and use it in GitHub Desktop.
example-gtk-keybinder.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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