1
我在Gtk+3
應用程序中使用Keybinder
,但它沒有得到任何組合鍵。 下面的代碼:Gtk Keybinder沒有響應
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import gi
gi.require_version('Keybinder', '3.0')
from gi.repository import Keybinder
from gi.repository import Gtk
def test_func(data):
print data
if __name__ == '__main__':
wnd = Gtk.Window()
wnd.connect('delete-event', Gtk.main_quit)
wnd.show_all()
if not Keybinder.bind('<Super>q', test_func, 'Hi there!'):
print "Keybinder.bind() failed."
Gtk.main()
我希望要執行的程序test_func
當我按下Windows+q
組合鍵,但它只是什麼都不做。 如果它有所作爲,我在Debian Jessie
和xfce4
上運行它。