<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>i3 FAQ - Individual question feed</title><link>https://faq.i3wm.org/questions/</link><description>Frequently asked questions and answers about the i3 window manager</description><atom:link href="http://faq.i3wm.org/feeds/question/1879/" rel="self"></atom:link><language>en</language><copyright>Copyright i3, 2012</copyright><lastBuildDate>Mon, 27 May 2013 09:41:33 +0000</lastBuildDate><item><title>programmatically send keybinging to i3</title><link>https://faq.i3wm.org/question/1879/programmatically-send-keybinging-to-i3/</link><description>Hey,

is it possible to artificially send specific keybinding to i3 so it executes the proper command? I couldn't find any sufficient command in protocol specification. I also tried sending XLib keyboard event using XSendEvent to the root window but it does nothing (or maybe I'm doing something wrong). 

Thanks!

Edit: What I want to do is catch Mod key before Virtualbox guest does that and pass it to i3. 
</description><pubDate>Fri, 24 May 2013 09:11:53 +0000</pubDate><guid>https://faq.i3wm.org/question/1879/programmatically-send-keybinging-to-i3/</guid></item><item><title>Comment by joepd for &lt;p&gt;Hey,&lt;/p&gt;

&lt;p&gt;is it possible to artificially send specific keybinding to i3 so it executes the proper command? I couldn't find any sufficient command in protocol specification. I also tried sending XLib keyboard event using XSendEvent to the root window but it does nothing (or maybe I'm doing something wrong). &lt;/p&gt;

&lt;p&gt;Thanks!&lt;/p&gt;

&lt;p&gt;Edit: What I want to do is catch Mod key before Virtualbox guest does that and pass it to i3. &lt;/p&gt;
</title><link>https://faq.i3wm.org/question/1879/programmatically-send-keybinging-to-i3/?comment=1891#comment-1891</link><description>Could you update the question so that you are asking for what you want to know? </description><pubDate>Sat, 25 May 2013 06:22:55 +0000</pubDate><guid>https://faq.i3wm.org/question/1879/programmatically-send-keybinging-to-i3/?comment=1891#comment-1891</guid></item><item><title>Comment by mariusz for &lt;p&gt;Hey,&lt;/p&gt;

&lt;p&gt;is it possible to artificially send specific keybinding to i3 so it executes the proper command? I couldn't find any sufficient command in protocol specification. I also tried sending XLib keyboard event using XSendEvent to the root window but it does nothing (or maybe I'm doing something wrong). &lt;/p&gt;

&lt;p&gt;Thanks!&lt;/p&gt;

&lt;p&gt;Edit: What I want to do is catch Mod key before Virtualbox guest does that and pass it to i3. &lt;/p&gt;
</title><link>https://faq.i3wm.org/question/1879/programmatically-send-keybinging-to-i3/?comment=1898#comment-1898</link><description>Actually I want to achieve the opposite - I want to catch windows key before virtualbox guest and use it with i3.</description><pubDate>Mon, 27 May 2013 09:14:17 +0000</pubDate><guid>https://faq.i3wm.org/question/1879/programmatically-send-keybinging-to-i3/?comment=1898#comment-1898</guid></item><item><title>Comment by joepd for &lt;p&gt;Hey,&lt;/p&gt;

&lt;p&gt;is it possible to artificially send specific keybinding to i3 so it executes the proper command? I couldn't find any sufficient command in protocol specification. I also tried sending XLib keyboard event using XSendEvent to the root window but it does nothing (or maybe I'm doing something wrong). &lt;/p&gt;

&lt;p&gt;Thanks!&lt;/p&gt;

&lt;p&gt;Edit: What I want to do is catch Mod key before Virtualbox guest does that and pass it to i3. &lt;/p&gt;
</title><link>https://faq.i3wm.org/question/1879/programmatically-send-keybinging-to-i3/?comment=1892#comment-1892</link><description>Think your question has been answered before: https://faq.i3wm.org/question/1656/how-can-i-pass-meta-key-presses-to-a-nested-instance-of-i3/</description><pubDate>Sat, 25 May 2013 06:25:08 +0000</pubDate><guid>https://faq.i3wm.org/question/1879/programmatically-send-keybinging-to-i3/?comment=1892#comment-1892</guid></item><item><title>Answer by mariusz for &lt;p&gt;Hey,&lt;/p&gt;

&lt;p&gt;is it possible to artificially send specific keybinding to i3 so it executes the proper command? I couldn't find any sufficient command in protocol specification. I also tried sending XLib keyboard event using XSendEvent to the root window but it does nothing (or maybe I'm doing something wrong). &lt;/p&gt;

&lt;p&gt;Thanks!&lt;/p&gt;

&lt;p&gt;Edit: What I want to do is catch Mod key before Virtualbox guest does that and pass it to i3. &lt;/p&gt;
 </title><link>https://faq.i3wm.org/question/1879/programmatically-send-keybinging-to-i3/?answer=1899#post-id-1899</link><description>Ok, so I eventually wrote a small program that catches windows key before virtualbox and evaluates i3 command through i3-msg. I placed it here: gist.github.com/5656098

It's not the fanciest method, but works for me.



Thanks for everyone's help!</description><pubDate>Mon, 27 May 2013 09:41:33 +0000</pubDate><guid>https://faq.i3wm.org/question/1879/programmatically-send-keybinging-to-i3/?answer=1899#post-id-1899</guid></item><item><title>Answer by vandannen for &lt;p&gt;Hey,&lt;/p&gt;

&lt;p&gt;is it possible to artificially send specific keybinding to i3 so it executes the proper command? I couldn't find any sufficient command in protocol specification. I also tried sending XLib keyboard event using XSendEvent to the root window but it does nothing (or maybe I'm doing something wrong). &lt;/p&gt;

&lt;p&gt;Thanks!&lt;/p&gt;

&lt;p&gt;Edit: What I want to do is catch Mod key before Virtualbox guest does that and pass it to i3. &lt;/p&gt;
 </title><link>https://faq.i3wm.org/question/1879/programmatically-send-keybinging-to-i3/?answer=1880#post-id-1880</link><description>You could use  `xdotool key ctrl+c` to emulate a keypress and -release of the specified key combination. But if you want to execute i3 commands, you should definitely use, e.g., `i3-msg workspace 1` to switch to the first workspace. i3-msg accepts all known i3 commands.</description><pubDate>Fri, 24 May 2013 10:08:42 +0000</pubDate><guid>https://faq.i3wm.org/question/1879/programmatically-send-keybinging-to-i3/?answer=1880#post-id-1880</guid></item><item><title>Comment by vandannen for &lt;p&gt;You could use  &lt;code&gt;xdotool key ctrl+c&lt;/code&gt; to emulate a keypress and -release of the specified key combination. But if you want to execute i3 commands, you should definitely use, e.g., &lt;code&gt;i3-msg workspace 1&lt;/code&gt; to switch to the first workspace. i3-msg accepts all known i3 commands.&lt;/p&gt;
</title><link>https://faq.i3wm.org/question/1879/programmatically-send-keybinging-to-i3/?comment=1883#comment-1883</link><description>I am not sure whether I understand what you want to achieve and where you defined your workspace keybindings. But if this is soley about virtualbox: you can define a host key (default is right ctrl key), which toggles the keyboard focus between the virtualbox guest and the host.</description><pubDate>Fri, 24 May 2013 11:57:05 +0000</pubDate><guid>https://faq.i3wm.org/question/1879/programmatically-send-keybinging-to-i3/?comment=1883#comment-1883</guid></item><item><title>Comment by mariusz for &lt;p&gt;You could use  &lt;code&gt;xdotool key ctrl+c&lt;/code&gt; to emulate a keypress and -release of the specified key combination. But if you want to execute i3 commands, you should definitely use, e.g., &lt;code&gt;i3-msg workspace 1&lt;/code&gt; to switch to the first workspace. i3-msg accepts all known i3 commands.&lt;/p&gt;
</title><link>https://faq.i3wm.org/question/1879/programmatically-send-keybinging-to-i3/?comment=1882#comment-1882</link><description>What I want to do is catch Mod key before Virtualbox guest does that and pass it to i3. Now I'm doing exactly what you suggested - I'm calling "i3-msg workspace N" if Mod+[0-9] is pressed. However, it would be better not to hardcode commands and let i3 do the work.</description><pubDate>Fri, 24 May 2013 11:27:28 +0000</pubDate><guid>https://faq.i3wm.org/question/1879/programmatically-send-keybinging-to-i3/?comment=1882#comment-1882</guid></item><item><title>Comment by vandannen for &lt;p&gt;You could use  &lt;code&gt;xdotool key ctrl+c&lt;/code&gt; to emulate a keypress and -release of the specified key combination. But if you want to execute i3 commands, you should definitely use, e.g., &lt;code&gt;i3-msg workspace 1&lt;/code&gt; to switch to the first workspace. i3-msg accepts all known i3 commands.&lt;/p&gt;
</title><link>https://faq.i3wm.org/question/1879/programmatically-send-keybinging-to-i3/?comment=1884#comment-1884</link><description>Another way would be to define a "pass-through"-mode in i3 and use this to control whether the guest or the host should interpret the shortcuts. (Then you should disable the autofocus of virtualbox for its guests.)</description><pubDate>Fri, 24 May 2013 12:05:44 +0000</pubDate><guid>https://faq.i3wm.org/question/1879/programmatically-send-keybinging-to-i3/?comment=1884#comment-1884</guid></item><item><title>Answer by joepd for &lt;p&gt;Hey,&lt;/p&gt;

&lt;p&gt;is it possible to artificially send specific keybinding to i3 so it executes the proper command? I couldn't find any sufficient command in protocol specification. I also tried sending XLib keyboard event using XSendEvent to the root window but it does nothing (or maybe I'm doing something wrong). &lt;/p&gt;

&lt;p&gt;Thanks!&lt;/p&gt;

&lt;p&gt;Edit: What I want to do is catch Mod key before Virtualbox guest does that and pass it to i3. &lt;/p&gt;
 </title><link>https://faq.i3wm.org/question/1879/programmatically-send-keybinging-to-i3/?answer=1890#post-id-1890</link><description>You could make a mode in your config (similar to resize), without any special commands, except a return keycombo. The $mod-key will lose all it's special meaning to i3 when in that mode, and will get passed on to the application. </description><pubDate>Sat, 25 May 2013 06:22:43 +0000</pubDate><guid>https://faq.i3wm.org/question/1879/programmatically-send-keybinging-to-i3/?answer=1890#post-id-1890</guid></item></channel></rss>