How do you remap a key to the Caps Lock key in Xubuntu?

1

I'm trying to remap my CapsLock key to Ctrl key as described here (adding /usr/bin/setxkbmap -option "ctrl:nocaps" command to "Session and Startup"->"Application Autostart").

But this doesn't work in Xubuntu 12.04.

When I'm running the same command (/usr/bin/setxkbmap -option "ctrl:nocaps") from terminal everything works as expected. If I change command to: sh -c "/usr/bin/setxkbmap -option \"ctrl:nocaps\"" it again works if I'm running it from terminal, but it doesn't work if I add it to xfce "Session and Startup" configurator. Also when I create a script like this:

#!/bin/sh /usr/bin/setxkbmap -option "ctrl:nocaps"

and add it to startup via "Session and startup" configurator, it has no effect at all. But if I run this script after login it actually remaps caps key as expected.

OK, my problem was because of xfce4-xkb-plugin. It was resetting xkb settings each time. I just installed xxkb instead of it, and now everything works absolutely...

0 0
2

This might be only a partial solution (I honestly don't know how it reacts to keyboard unplugging/replugging), but since you already have a script that does what you want, this might be close enough.

On startup, X11 executes several special programs, if they are present on the system. For our purposes, the most interesting is likely ~/.xsession, which is executed after you have logged in through a display manager, which is the normal setup for a graphical environment these days. (It used to be that you normally logged in to a shell and then ran the command startx to start X; if so, you used ~/.xinitrc for the same purpose.)

We can leverage this to execute commands virtually regardless of what display manager (gdm, gdm3, kdm, ...) and desktop environment (GNOME, Xfce, KDE, ...) you are using.

Create a file named .xsession and place it in your home directory. Add the following to it:
#!/bin/bash
/usr/bin/setxkbmap -option "ctrl:nocaps" Save, and set the...
0 0
3

I have grown very comfortable to my Colemak keyboard layout (my typing speed has doubled since I started using it). My only problem with it is that there is no caps lock key because under this layout because the caps lock key is a second backspace key. I really miss caps lock so I would like to change the backspace key on the top right corner of my keyboard (not the one right next to the "a") into a caps lock key. Is there a way to do this using xmodmap or some other tool? I am using Xfce.

Edit /usr/share/X11/xkb/symbols/de (where /de is your language) and add this section in the first block, that you use in your language:

# replace Caps with Backspace key { [ BackSpace ] };

But I would recommend better to replace it with AltGr and them map AltGr+f to backspace:

# replace Caps with AltGr key { [ ISO_Level3_Shift ] }; # Add Backspace to AltGr+f key { [ f, F, BackSpace, BackSpace ] };

So you can add more useful shortcuts like...

0 0
4

I've seen lots of posts to various forums on how fiddle with the caps lock key. The easiest is to uses System Settings > Keyboard | Keyboard Layout, then click Options, then make a selection under Caps Lock Key Behaviour. Trouble is, the behaviour I want doesn't appear in the list.

I want the Caps Lock to function as a simple SHIFT key. Because often when I'm typing I hit CapsLock instead of SHIFT -- so I don't want ESC or CTRL mapped there.

I tried all kinds of things with setxkbmap -option caps:____ but haven't figured out to make it work.

if this can't be done, pls let me know, and I'll just turn it off with systems settings or setxkbmap -option...

0 0
5

In this post, learn how to change the default behavior of keys on the keyboard in Ubuntu, especially useful for multimedia keys.

Newer versions of Ubuntu use xkb for keyboard layouts. xkb works with a hierarchy of multiple files to handle different keyboard settings. New entries can be added to one main config file which can change the behavior of the keys or in other words keys can be remapped.

In this how to I will be changing the top row keys on my Chromebook, but you can use this method for your laptop or desktop keyboard. Wouldn’t it be nice to have multimedia keys on your old keyboard?

Setting up the Chromebook F keys in 3 steps

Update: If you are using this guide for your Chromebook, see this post which will do this automatically for you.

A fresh install of Ubuntu on a chromebook maps the top row keys to the F keys (F1, F2 …). Let’s change them to match their button icons.

On chromebooks there is no caps lock key and in it’s place...

0 0
6

If you are a VIM user, you probably find yourself stretching your poor little pinkey to the upper-left corner of your keyboard all of the time. How annoying! You probably also find yourself never hitting the Caps Lock key, which is totally useless since one can hold the shift key for the same effect, and annoying as heck because it is right on the home row!

Luckily, there is help. Download the PC Keyboard Hack application, and install it. This is a pretty cool app that lets us change what signals the OS interprets from key presses. It adds an entry to your System Preferences for configuring it.

To get the Caps Lock sending the escape code, you’ll want to set it to 53:

PC Keyboard Hack

Now that that is done, pressing Caps Lock will now send the escape code. Go ahead, try it out! You’ll notice that the light on the key no longer toggles either.

But, we can do a little better. If you were to tap each key on your keyboard very quickly, you would...

0 0
7

Advertisement

Whether you’re missing a key on your keyboard or just want to improve your productivity, remapping can be extremely useful.

Remapping keys on your computer’s keyboard allows you to change any key to any other key, allowing you to personalize your keyboard exactly how you like it. Don’t like the location of a particular key? Just change it.

Though we’ve looked at how to remap keys in the past, let’s look now at some ways in which that can be useful.

Improve Your Productivity

Here are a few instances in which you might want to remap your keys, and we’ll go through each of them to see how to do it best.

Computer gaming Browser productivity Launch and switch apps quickly Use a foreign keyboard with ease Use a better keyboard layout Make use of your underused keys Fix a missing key

Interested in any of these? Read on to find out to how to make the most use out of them — but first, let’s look at the software that makes this...

0 0
8

If you are a polite citizen of the Web, you probably rarely use your Caps Lock key. However, it’s in such a useful place on the keyboard, and it would be a shame to see it go to waste. If you want to remap it to be more useful, you can replace your Escape Key with your Caps Lock key in macOS Sierra. This is especially helpful if you have one of the new Touch Bar MacBook Pros, since they completely lack a physical Escape key, opting instead for an “Escape Zone” on the Touch Bar.

1. Open System Preferences under the Apple menu.

2. Open the Keyboard preferences pane found in the second row of System Preferences.

3. Click the “Modifier Keys…” button in the lower-right of the preference pane window.

4. Click the drop-down box next to the “Caps Lock” key.

5. Choose “Escape” from the drop-down list.

6. Click the “OK” button to confirm your change.

You can swiftly and easily remap your “Escape” key to your “Caps Lock” key using the keyboard...

0 0
9
...
0 0