0

I write a native GUI with gtk, which needs to receive keyboard events although the window does not have the focus.

The gtk window should be minified and run in background. If the user types a shortcut, the window should get on the foreground and get the focus.

Up to now the shortcut does not matter. It should be easy and fast to be entered and should not clash with a shortcut which is already in use.

The GUI should run on linux and windows.

How could a shortcut get registered? I guess this needs to be implemented in a platform specific way. If you know the answer for one platform, let me know.

guettli
  • 25,042
  • 81
  • 346
  • 663
  • When no window is selected, global keystrokes are usually intercepted by the window manager, so you are not dealing with linux + windows but with windows + openbox + fluxbox + awesomewm + xfwm + ... – ntd Jun 01 '13 at 08:56
  • Binding a global shortcut is not supported directly in gtk, you can see this library, which support a global keybinding in Gtk apps for X11, with C, vala, python language support. It's easy to use. https://github.com/engla/keybinder.git – LiuLang Jun 01 '13 at 08:59
  • Alternatively, we can call X11/X11 function, see this question. http://stackoverflow.com/questions/4037230/global-hotkey-with-x11-xlib – LiuLang Jun 01 '13 at 09:00

0 Answers0