0

I want single-button shortcuts for copying and pasting. I never use the music buttons I have on my keyboard (Logitech k540), so I decided to use them.

How can I do this?

(I'm on Ubuntu 22.04.3 LTS)

I have created custom shortcuts that have "Audio previous" and "Audio next" as their shortcut. I have installed xdotool and have given xdotool getactivewindow key ctrl+c and xdotool getactivewindow key ctrl+v as their commands, respectively.

Like so:

screenshot of custom shortcut dialog

But it doesn't work. When I press the respective buttons, all I get is a ⦸ symbol at the bottom of my screen for a few seconds. Nothing is copied, nothing is pasted.

How can I make this work?

Kitalda
  • 113

1 Answers1

3

Since the comment helped you solve the issue, I am adding that answer here.

You can use the "Input Remapper" software in Ubuntu which provides a GUI and recognizes keys that are not recognized by xbindkeys, xinput, etc.

Installation

Command line:

sudo apt install git python3-setuptools gettext
git clone https://github.com/sezanzeb/input-remapper.git
cd input-remapper && ./scripts/build.sh
sudo apt install -f ./dist/input-remapper-2.0.1.deb

GUI:

You can find the software in the Software Center (or App Center) on Ubuntu.

app-center-screenshot

Interface

In the GUI, the software will list all the devices that are connected to your PC.

After selecting your device, you will get a window to edit your keys. There you have to add:

  • Rename: Add a name to the mapping profile and press the down-arrow button on the right
  • Add: Use that button to create a new keymap for your profile. You may need to Stop the injection if you have already set up mapping before.
  • Record: Use this button after selecting your new key binding and record your keys.
  • Output: You can edit the output of your new input on the right side of the window. You can refer to the project's Usage section for several key inputs.
  • Apply: Click on this button and also turn on the Autoload so that the profile gets activated once the software starts.

Also, don't forget to add this software to the Startup application along with enabling the Autoload option so that it will automatically map the key once you log in to the system.

Ajay
  • 1,246