How do I turn off or repurpose the CAPSLOCK key?

Update: My main goal is to change the function (or even turn off) the CAPSLOCK key.

At work, we have a long domain name. I'm lazy. I'd like to map my CAPSLOCK key to type out a string such as "outlongdomain.com". This is only to save me from typing.

I've seen numerous questions about how to remap the key to a different function. While neat; I couldn't see how to tell the system to "print out these next set of letters where the cursor has focus."

Update: I would like to use Autokey but I don't see an option for CAPSLOCK enter image description here


If you can be satisfied with it just being disabled, here's what you can do.

  1. Run sudo apt-get install gnome-tweak-tool.
  2. Open Tweak Tool by searching for it in the Dash.
  3. Select the Typing menu and change Caps lock key behavior to Disabled.

Example

Source: https://mkaz.com/2014/02/08/disable-caps-lock-in-ubuntu/


To remap the Capslock to something like Control, Esc, I'd recommend using the gnome-tweak-tool.

Open the Tweak Tool application or press Alt-F2 and run gnome-tweak-tool.

Select the "Typing" tab, and change the dropdown for Caps Lock key Behaviour.

Here's how it looks on my system:

The Gnome Tweak Tool on the 'Typing' Tab.

Now for making a key combination to type "outlongdomain.com":

I have scoured the internet for an answer to this question, but I haven't found anything straightforward, so here's my workaround idea using the xclip package:

Open Settings > Keyboard > Shortcuts > Custom Shortcuts and add a shortcut. Name it whatever you want, and use this command:

echo "hello" | xclip -selection clipboard

But replacing "hello" with your long domain name that you want to type. Now just click the Disabled text on the shortcut and set it to whatever you set your Capslock key to.

Now when you use the new keyboard shortcut, that long domain name will instantly be copied to your clipboard, ready to use with Ctrl-V