To simulate keyboard events I suggest you the great tool xdotool .
1. Install xdotool
via terminal (CTRL+ALT+T):
sudo apt-get install xdotool
or use the Software Center .
2. Create a script that uses xdotool to emulate the key down events of CTRL and v. In the terminal:
mkdir -p ~/bin
gedit ~/bin/fakepaste
Copy the following content into the editor window that opened up. After copying the code save, then close it:
#!/bin/sh
exec /usr/bin/xdotool key CTRL+V
EOF
Now make the script executable:
chmod +x ~/bin/fakepaste
3. Log out and log in to reload your PATH.
4. Create the custom shortcut
Go to System Settings
, then go to Keyboard
, then Shortcuts
.
Press the +
button at the bottom of the dialog. Provide a name for the shortcut you're about to create and for the command fill in: fakepaste
. Press OK
.
Next to your new shortcut you will see disabled
. Click on that text and then press the key you want to be assigned to your keyboard emulation.
You should now be able to use your search key for pasting!
Solaar is a graphical utility that has the ability to configure the Fn key functionality on newer devices:
Since Ubuntu 15.04 (Vivid), Solaar can be installed from the repositories (sudo apt-get install solaar
). After installation, you can search for Solaar in the applications menu and start it from there.
A command line interface is also available. Example usage:
$ solaar show
...
2: Wireless Illuminated Keyboard K800
...
$ solaar config 2
fn-swap = False
$ solaar config 2 fn-swap on
fn-swap = True
Note that these settings are not persistent, you will loose it after reboot. This may change in future versions of Solaar.
I have previously created the ltunify
tool which is a Unifying tool that is able to communicate in the older HID++ 1.0 protocol. Until the next version of Solaar is released (current version is 0.8.7), you can use ltunify
to toggle the Fn key on an older device such as the K800 keyboard.
Installation instructions (taken from https://askubuntu.com/a/114089/6969):
sudo apt-get install git gcc
git clone https://git.lekensteyn.nl/ltunify.git -b fkeyswap
cd ltunify
make install-home
The command ltunify fkeyswap
shows the current status:
$ sudo ltunify fkeyswap
F key functions are not swapped
To swap the functionality, run ltunify fkeyswap on
:
$ sudo ltunify fkeyswap on
F key functions are now swapped
There is also an off
action:
$ sudo ltunify fkeyswap off
F key functions are now normal
Please leave a comment if it does not work so it can be fixed. The above functionality uses undocumented hardware registers.
Best Answer
This is currently the best solution I found, although I think at this time, its smooth scrolling feature is not yet useable. In future, native, driver-based solutions have to be made to support mice and touchpads which support smooth scrolling. Especially on a desktop system like Ubuntu.
Solaar
There is an application called Solaar which offers many possibilities to unifying-devices from Logitech, like battery status, pairing options (awesome!) and smooth scrolling. Unfortunately, smooth scrolling does not work that great; it does not scroll as smoothly as on OS X, and it only scrolls the last active window, not the mouse-overed window (tested on 13.04). But it's in every way a useful application and its smooth scrolling feature is something I hope gets improved with future updates.
Homepage: http://pwr.github.io/Solaar/
Installation
Open a Terminal via the Unity dash or CTRL+ALT+T and paste in the following lines:
Usage