<?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/6901/" rel="self"></atom:link><language>en</language><copyright>Copyright i3, 2012</copyright><lastBuildDate>Sat, 24 Oct 2015 17:40:55 +0000</lastBuildDate><item><title>Mouse button press-hold-release through keyboard</title><link>https://faq.i3wm.org/question/6901/mouse-button-press-hold-release-through-keyboard/</link><description>My mouse is loud, and I have set these commands

    bindsym Mod1+F1 exec xdotool click 1
    bindsym Mod1+F2 exec xdotool click 2
    bindsym Mod1+F3 exec xdotool click 3
They click fine but don't support drag and drop functionality.

I'm in situation where I want to move real mouse for precise positioning but emulate clicks and drags with notebook keyboard keys.

Is there a way to accomplish this ?</description><pubDate>Mon, 12 Oct 2015 01:20:16 +0000</pubDate><guid>https://faq.i3wm.org/question/6901/mouse-button-press-hold-release-through-keyboard/</guid></item><item><title>Answer by nezabudka for &lt;p&gt;My mouse is loud, and I have set these commands&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;bindsym Mod1+F1 exec xdotool click 1
bindsym Mod1+F2 exec xdotool click 2
bindsym Mod1+F3 exec xdotool click 3
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;They click fine but don't support drag and drop functionality.&lt;/p&gt;

&lt;p&gt;I'm in situation where I want to move real mouse for precise positioning but emulate clicks and drags with notebook keyboard keys.&lt;/p&gt;

&lt;p&gt;Is there a way to accomplish this ?&lt;/p&gt;
 </title><link>https://faq.i3wm.org/question/6901/mouse-button-press-hold-release-through-keyboard/?answer=7038#post-id-7038</link><description>    #sudo apt install xdotool
    bindsym $mod+Return exec xdotool click 1
    bindsym Mod4+F2 exec xdotool click 2
    bindsym Mod4+Return exec xdotool click 3
    bindsym Mod4+Up exec xdotool click 4    #прокрутка вверх
    bindsym Mod4+Down exec xdotool click 5  #прокрутка вниз
    bindsym $mod+Up exec xdotool mousemove_relative -- 0 -15
    bindsym $mod+Down exec xdotool mousemove_relative 0 15
    bindsym $mod+Right exec xdotool mousemove_relative 15 0
    bindsym $mod+Left exec xdotool mousemove_relative -- -15 0
     </description><pubDate>Sat, 24 Oct 2015 17:40:55 +0000</pubDate><guid>https://faq.i3wm.org/question/6901/mouse-button-press-hold-release-through-keyboard/?answer=7038#post-id-7038</guid></item><item><title>Answer by c0ffeeartc for &lt;p&gt;My mouse is loud, and I have set these commands&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;bindsym Mod1+F1 exec xdotool click 1
bindsym Mod1+F2 exec xdotool click 2
bindsym Mod1+F3 exec xdotool click 3
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;They click fine but don't support drag and drop functionality.&lt;/p&gt;

&lt;p&gt;I'm in situation where I want to move real mouse for precise positioning but emulate clicks and drags with notebook keyboard keys.&lt;/p&gt;

&lt;p&gt;Is there a way to accomplish this ?&lt;/p&gt;
 </title><link>https://faq.i3wm.org/question/6901/mouse-button-press-hold-release-through-keyboard/?answer=6922#post-id-6922</link><description>`bindsym` wasn't enough, so I used `xbindkeys` for this

    # inside ~/.xbindkeysrc
    "xdotool mousedown 1"
        Alt + F1
    "xdotool mouseup 1"
        Alt + F1 + Release
    # same for mouse2 F2 and mouse3 F3

There was F1, F2, F3 hold key repetition problem, luckily `xset` has option to disable repeat for specific keycodes

    xset -r 67
    xset -r 68
    xset -r 69

Clicks and drags work well now</description><pubDate>Tue, 13 Oct 2015 20:57:44 +0000</pubDate><guid>https://faq.i3wm.org/question/6901/mouse-button-press-hold-release-through-keyboard/?answer=6922#post-id-6922</guid></item><item><title>Answer by Anon1234 for &lt;p&gt;My mouse is loud, and I have set these commands&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;bindsym Mod1+F1 exec xdotool click 1
bindsym Mod1+F2 exec xdotool click 2
bindsym Mod1+F3 exec xdotool click 3
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;They click fine but don't support drag and drop functionality.&lt;/p&gt;

&lt;p&gt;I'm in situation where I want to move real mouse for precise positioning but emulate clicks and drags with notebook keyboard keys.&lt;/p&gt;

&lt;p&gt;Is there a way to accomplish this ?&lt;/p&gt;
 </title><link>https://faq.i3wm.org/question/6901/mouse-button-press-hold-release-through-keyboard/?answer=6918#post-id-6918</link><description>Run:
&gt;     setxkbmap -option keypad:pointerkeys

shift+numlock now will activate the numpad mouse mode:

&gt;     7, 8 ,9 are the up directions
&gt;     4, 6 are left and right
&gt;     1, 2, 3 are the down directions 
&gt; 
&gt;     / selects the left mouse key
&gt;     * selects the middle mouse key
&gt;     - selects the right mouse key 
&gt; 
&gt;     Press 5 or + do to the actual mouseclick
&gt;     Press 0/Ins to press and hold the selected mouse key (e.g. for dragging
&gt;     something)
&gt;     Press ./Del to release the currently selected mouse key. 
&gt; 
&gt;     First select the mouse key you want to
&gt;     (ab)use by pressing / for left mouse
&gt;     key, - for the right botton or * for
&gt;     the middle and then press 5 to do the
&gt;     actual click-

[Source](http://en.linuxreviews.org/HOWTO_use_the_numeric_keyboard_keys_as_mouse_in_XOrg)
</description><pubDate>Tue, 13 Oct 2015 18:08:17 +0000</pubDate><guid>https://faq.i3wm.org/question/6901/mouse-button-press-hold-release-through-keyboard/?answer=6918#post-id-6918</guid></item><item><title>Comment by c0ffeeartc for &lt;p&gt;Run:&lt;/p&gt;

&lt;blockquote&gt;
&lt;pre&gt;&lt;code&gt;setxkbmap -option keypad:pointerkeys
&lt;/code&gt;&lt;/pre&gt;
&lt;/blockquote&gt;

&lt;p&gt;shift+numlock now will activate the numpad mouse mode:&lt;/p&gt;

&lt;blockquote&gt;
&lt;pre&gt;&lt;code&gt;7, 8 ,9 are the up directions
4, 6 are left and right
1, 2, 3 are the down directions 

/ selects the left mouse key
* selects the middle mouse key
- selects the right mouse key 

Press 5 or + do to the actual mouseclick
Press 0/Ins to press and hold the selected mouse key (e.g. for dragging
something)
Press ./Del to release the currently selected mouse key. 

First select the mouse key you want to
(ab)use by pressing / for left mouse
key, - for the right botton or * for
the middle and then press 5 to do the
actual click-
&lt;/code&gt;&lt;/pre&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="http://en.linuxreviews.org/HOWTO_use_the_numeric_keyboard_keys_as_mouse_in_XOrg"&gt;Source&lt;/a&gt;&lt;/p&gt;
</title><link>https://faq.i3wm.org/question/6901/mouse-button-press-hold-release-through-keyboard/?comment=6921#comment-6921</link><description>Thanks for great answer. I use notebook without numpad though. I'm in weird situation where I can and prefer to move real mouse but click with keyboard keys. I'll add this to main question to make things clear</description><pubDate>Tue, 13 Oct 2015 20:28:56 +0000</pubDate><guid>https://faq.i3wm.org/question/6901/mouse-button-press-hold-release-through-keyboard/?comment=6921#comment-6921</guid></item><item><title>Answer by Airblader for &lt;p&gt;My mouse is loud, and I have set these commands&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;bindsym Mod1+F1 exec xdotool click 1
bindsym Mod1+F2 exec xdotool click 2
bindsym Mod1+F3 exec xdotool click 3
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;They click fine but don't support drag and drop functionality.&lt;/p&gt;

&lt;p&gt;I'm in situation where I want to move real mouse for precise positioning but emulate clicks and drags with notebook keyboard keys.&lt;/p&gt;

&lt;p&gt;Is there a way to accomplish this ?&lt;/p&gt;
 </title><link>https://faq.i3wm.org/question/6901/mouse-button-press-hold-release-through-keyboard/?answer=6904#post-id-6904</link><description>It might be posible like this:

    bindsym Mod1+F1 exec --no-startup-id xdotool mousedown 1
    bindsym --release Mod1+F1 exec --no-startup-id xdotool mouseup 1

You'll have to try it out.</description><pubDate>Mon, 12 Oct 2015 08:13:41 +0000</pubDate><guid>https://faq.i3wm.org/question/6901/mouse-button-press-hold-release-through-keyboard/?answer=6904#post-id-6904</guid></item><item><title>Comment by c0ffeeartc for &lt;p&gt;It might be posible like this:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;bindsym Mod1+F1 exec --no-startup-id xdotool mousedown 1
bindsym --release Mod1+F1 exec --no-startup-id xdotool mouseup 1
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;You'll have to try it out.&lt;/p&gt;
</title><link>https://faq.i3wm.org/question/6901/mouse-button-press-hold-release-through-keyboard/?comment=6911#comment-6911</link><description>Thanks. I tested in blender and then xev. xev says both mousedown and mouseup events fire after key release</description><pubDate>Tue, 13 Oct 2015 13:36:34 +0000</pubDate><guid>https://faq.i3wm.org/question/6901/mouse-button-press-hold-release-through-keyboard/?comment=6911#comment-6911</guid></item></channel></rss>