【发布时间】:2013-10-02 20:27:36
【问题描述】:
我在Gtk+3 应用程序中使用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()
我希望程序在我按下Windows+q 组合键时执行test_func,但它什么也不做。
我会在 Debian Jessie 和 xfce4 上运行它,如果它有所作为的话。
【问题讨论】: