14 added 380 characters in body
source | link

W00T !

First : create a script click:

#!/bin/bash

id=$(
    xinput list |
        awk '/Dell USB Keyboard/{print gensub(/.*id=([0-9]+).*/, "\\1", "1")}'
)
xdotool mousedown $1
while IFS= read -r event; do
    if [[ $event == *release* ]]; then
        xdotool mouseup $1
        exit
    fi
done < <(xinput test $id)

Then add a new keyboard shortcut in your window manager and map F1 to run /path/to/mouse <1|3> (left OR right click).

Et voilà ;)

This can be ran with xbindkeys to be WM agnostic

Edit:

don't know why this doesn't work with archlinux + xfce 4.12 but on Debian9 + Cinnamon

Edit :

This solution works better :

In .bashrc :

xmodmap -e "keycode 67 = Pointer_Button1 Pointer_Button1"
xmodmap -e "keycode 68 = Pointer_Button2"
xmodmap -e "keycode 69 = Pointer_Button3"

As a keyboard shortcut :

#!/bin/bash

id=$(
    xinput list |
        awk '/Dell USB Keyboard/{print gensub(/.*id=([0-9]+).*/, "\\1", "1")}'
)


(
    while read event; do
        if [[ $event == *release* ]]; then
            xkbset -m
            exit
        fi
    done < <(xinput test $id)
) &
xkbset m

W00T !

First : create a script click:

#!/bin/bash

id=$(
    xinput list |
        awk '/Dell USB Keyboard/{print gensub(/.*id=([0-9]+).*/, "\\1", "1")}'
)
xdotool mousedown $1
while IFS= read -r event; do
    if [[ $event == *release* ]]; then
        xdotool mouseup $1
        exit
    fi
done < <(xinput test $id)

Then add a new keyboard shortcut in your window manager and map F1 to run /path/to/mouse <1|3> (left OR right click).

Et voilà ;)

This can be ran with xbindkeys to be WM agnostic

Edit:

don't know why this doesn't work with archlinux + xfce 4.12 but on Debian9 + Cinnamon

W00T !

First : create a script click:

#!/bin/bash

id=$(
    xinput list |
        awk '/Dell USB Keyboard/{print gensub(/.*id=([0-9]+).*/, "\\1", "1")}'
)
xdotool mousedown $1
while IFS= read -r event; do
    if [[ $event == *release* ]]; then
        xdotool mouseup $1
        exit
    fi
done < <(xinput test $id)

Then add a new keyboard shortcut in your window manager and map F1 to run /path/to/mouse <1|3> (left OR right click).

Et voilà ;)

This can be ran with xbindkeys to be WM agnostic

Edit:

don't know why this doesn't work with archlinux + xfce 4.12 but on Debian9 + Cinnamon

Edit :

This solution works better :

In .bashrc :

xmodmap -e "keycode 67 = Pointer_Button1 Pointer_Button1"
xmodmap -e "keycode 68 = Pointer_Button2"
xmodmap -e "keycode 69 = Pointer_Button3"

As a keyboard shortcut :

#!/bin/bash

id=$(
    xinput list |
        awk '/Dell USB Keyboard/{print gensub(/.*id=([0-9]+).*/, "\\1", "1")}'
)


(
    while read event; do
        if [[ $event == *release* ]]; then
            xkbset -m
            exit
        fi
    done < <(xinput test $id)
) &
xkbset m
13 added 5 characters in body
source | link

W00T !

First : create a script click:

#!/bin/bash

id=$(
    xinput list |
        awk '/Dell USB Keyboard/{print gensub(/.*id=([0-9]+).*/, "\\1", "1")}'
)
xdotool mousedown $1
while IFS= read -r event; do
    if [[ $event == *release* ]]; then
        xdotool mouseup $1
        exit
    fi
done < <(xinput test $id)

Then add a new keyboard shortcut in your window manager and map F1 to run /path/to/mouse <1|3> (left &OR right click).

Et voilà ;)

This can be ran with xbindkeys to be WM agnostic

Edit:

don't know why this doesn't work with archlinux + xfce 4.12 but on Debian9 + Cinnamon

W00T !

First : create a script click:

#!/bin/bash

id=$(
    xinput list |
        awk '/Dell USB Keyboard/{print gensub(/.*id=([0-9]+).*/, "\\1", "1")}'
)
xdotool mousedown $1
while IFS= read -r event; do
    if [[ $event == *release* ]]; then
        xdotool mouseup $1
        exit
    fi
done < <(xinput test $id)

Then add a new keyboard shortcut in your window manager and map F1 to run /path/to/mouse <1|3> (left & right click).

Et voilà ;)

This can be ran with xbindkeys to be WM agnostic

Edit:

don't know why this doesn't work with archlinux + xfce 4.12 but on Debian9 + Cinnamon

W00T !

First : create a script click:

#!/bin/bash

id=$(
    xinput list |
        awk '/Dell USB Keyboard/{print gensub(/.*id=([0-9]+).*/, "\\1", "1")}'
)
xdotool mousedown $1
while IFS= read -r event; do
    if [[ $event == *release* ]]; then
        xdotool mouseup $1
        exit
    fi
done < <(xinput test $id)

Then add a new keyboard shortcut in your window manager and map F1 to run /path/to/mouse <1|3> (left OR right click).

Et voilà ;)

This can be ran with xbindkeys to be WM agnostic

Edit:

don't know why this doesn't work with archlinux + xfce 4.12 but on Debian9 + Cinnamon

12 added 29 characters in body
source | link

W00T !

First : create a script left-click:

#!/bin/bash

id=$(
    xinput list |
        awk '/Dell USB Keyboard/{print gensub(/.*id=([0-9]+).*/, "\\1", "1")}'
)
xdotool mousedown 1$1
while IFS= read -r event; do
    if [[ $event == *release* ]]; then
        xdotool mouseup 1$1
        exit
    fi
done < <(xinput test $id)

Then add a new keyboard shortcut in your window manager and map F1 to run this script/path/to/mouse <1|3> (left & right click).

Et voilà ;)

This can be ran with xbindkeys to be WM agnostic

Edit:

don't know why this doesn't work with archlinux + xfce 4.12 but on Debian9 + Cinnamon

W00T !

First : create a script left-click:

#!/bin/bash

id=$(
    xinput list |
        awk '/Dell USB Keyboard/{print gensub(/.*id=([0-9]+).*/, "\\1", "1")}'
)
xdotool mousedown 1
while IFS= read -r event; do
    if [[ $event == *release* ]]; then
        xdotool mouseup 1
        exit
    fi
done < <(xinput test $id)

Then add a new keyboard shortcut in your window manager and map F1 to run this script.

Et voilà ;)

This can be ran with xbindkeys to be WM agnostic

Edit:

don't know why this doesn't work with archlinux + xfce 4.12 but on Debian9 + Cinnamon

W00T !

First : create a script click:

#!/bin/bash

id=$(
    xinput list |
        awk '/Dell USB Keyboard/{print gensub(/.*id=([0-9]+).*/, "\\1", "1")}'
)
xdotool mousedown $1
while IFS= read -r event; do
    if [[ $event == *release* ]]; then
        xdotool mouseup $1
        exit
    fi
done < <(xinput test $id)

Then add a new keyboard shortcut in your window manager and map F1 to run /path/to/mouse <1|3> (left & right click).

Et voilà ;)

This can be ran with xbindkeys to be WM agnostic

Edit:

don't know why this doesn't work with archlinux + xfce 4.12 but on Debian9 + Cinnamon

11 added 68 characters in body
source | link
10 added 5 characters in body
source | link
9 deleted 10 characters in body
source | link
8 deleted 235 characters in body
source | link
7 added 239 characters in body
source | link
6 deleted 36 characters in body
source | link
5 deleted 6 characters in body
source | link
4 deleted 35 characters in body
source | link
3 added 19 characters in body
source | link
2 added 72 characters in body
source | link
1
source | link