Search code examples
c++backgroundcross-platformwxwidgetsclipboard

A c++ cross-platform background clipboard manager


So, I've decided to develop my first app. Basically, its functionality is just sitting in the background, waiting for hotkeys (by default they're something like Ctrl-Shift-Key) to handle:

  • Ctrl-Shift-C provides access to advanced clipboard (probably after programmatically pressing Ctrl-C);
  • Ctrl-Shift-V draws a pool of all copied objects;
  • etc.

After a brief research, I've found wxWidgets, providing a way to build a GUI app as well as a clipboard access. Unfortunately, key hooking in the background turns out a way more complex thing than this. As far as I saw, there is no chance I could avoid diving into OS APIs, am I right?

I would really appreciate if someone could show me a direction to investigate this issue, and some tips.

Also hoping there is a way to somehow bind wxWidgets GUI app with a (hopefully) little pieces of platform-dependent code.


Solution

  • Under MSW and Mac you can use wxWindow::RegisterHotKey() to be notified about key presses even when your application doesn't have focus. Unfortunately this function is not implemented for Linux/GTK port and I don't know how could this be done there. If you find a way to do it, don't hesitate to submit patches to wxWidgets itself, and then you could use this function under all platforms.