Detect specific keypresses in GUI

后端 未结 1 928
走了就别回头了
走了就别回头了 2021-01-26 04:27

I\'m looking for a way in Gtk/Python to have an app listen for keypresses and when some of the special keys are pressed, perform an action (recreate a menu with different labels

相关标签:
1条回答
  • 2021-01-26 04:33

    You probably need to handle the "key-press-event" (and probably also "key-release-event") of GtkWidget. PyGtk knows about it.

    It should be inside some "windowing" widget, so you may need to use GtkEventBox as a container.

    0 讨论(0)
提交回复
热议问题