Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Ubuntu uses <a href="http://en.wikipedia.org/wiki/GConf" rel="nofollow noreferrer">GConf</a> to store settings. It looks like Windows registry. <a href="http://www.howtogeek.com/howto/ubuntu/assign-custom-shortcut-keys-on-ubuntu-linux/" rel="nofollow noreferrer">Those keys</a> are for storing global shortcuts. To set up global keybingings you should deal with GTK. So install those packages:</p> <p><img src="https://i.stack.imgur.com/PpOHU.png" alt="App Centre"></p> <p>And add to your <code>.pro</code> file following lines:</p> <pre><code>INCLUDEPATH += /usr/include/gconfmm-2.6\ /usr/include/glibmm-2.4\ /usr/lib/glibmm-2.4/include\ /usr/include/glib-2.0\ /usr/lib/glib-2.0/include\ /usr/include/sigc++-2.0\ /usr/lib/sigc++-2.0/include\ /usr/include/gconf/2 LIBS += -L/usr/lib -lgconfmm-2.6 </code></pre> <p>then you need to create new <code>.cpp</code> file or class besause you can't include Qt and GTK headers in the same file. </p> <pre><code>#include &lt;gconfmm.h&gt; using namespace Gnome; </code></pre> <p>and the main part:</p> <pre><code>Conf::init(); try { Glib::RefPtr&lt;Conf::Client&gt; pointer(Conf::Client::get_default_client()); pointer-&gt;set("/apps/metacity/keybinding_commands/command_2",Glib::ustring("gedit")); pointer-&gt;set("/apps/metacity/global_keybindings/run_command_2",Glib::ustring("&lt;Control&gt;&lt;Alt&gt;e")); } catch(Conf::Error error) { std::cerr &lt;&lt; "Error code: " &lt;&lt; error.code(); } </code></pre> <p>You can use all predefined keys instead of <code>command_2</code> (there are <code>command_screenshot</code>, for example) and you can create your own keys such as</p> <pre><code>/apps/metacity/keybinding_commands/command_textedit /apps/metacity/global_keybindings/run_command_textedit </code></pre> <p>but you also need to set up schemas for your custom keys (I don't know how to do it, I'm new to GTK). After code is executed shortcuts work well.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload