Hi. You will have to deal with this separately for the X server and for the command line interface.
To remap a key for the command line (note that this will not affect X terminal emulators, for which you have to configure xkb - please see below) run the command 'showkey' first, in order to know the relevant keycode: just run 'showkey' and press the key to which you want to remap, then wait for 10 seconds to let the program stop. The kbd keymap used by your system is probably 'uk.map' and its location should be something like '/usr/share/kbd/keymaps/i386/qwerty/'. Make a backup copy of the compressed map file (e.g. 'uk.map.gz') and decompress it with gzip:
Code:
# gzip -d uk.map.gz
By the way, on Slackware I can see which layout is loaded at boot time in the script '/etc/rc.d/rc.keymap', however on Mint this should be somewhere else in '/etc/init.d/'. Edit the decompressed keymap file by adding a line at the proper place for the relevant keycode. Let's say that you want to use the right 'Win' key (code 126) for the backslash and the pipe, so you may add a line like this:
Code:
keycode 126 = backslash bar
Compress the file again and reload the keymap:
Code:
# gzip uk.map
# loadkeys uk.map.gz
This way you will obtain the backslash by pressing the right 'Win' key, and by using it with "Shift" you will get the pipe instead.
As mentioned, the above will affect the command line terminal alone. Regarding the X server, it is somewhat simpler. You need to add a rule to the relevant symbols file for xkb, which you should find in '/usr/share/X11/xkb/symbols/'. In your case you will probably have to edit the file named 'gb'. In order to obtain a result similar to the above, add a line like this to the "Alphanumeric section":
Code:
key <RWIN> { [ backslash, bar ] };
The documentation for xkb will be useful to identify the
right code for a given key. Restarting the X server should be enough in order to load the modified map. I have no idea if conflicts of some kind may arise under certain conditions with this kind of key re-mappings: I didn't notice any issues so far.
<Edit>
As an alternative, these will use the '/' key of the numpad: "Shift + /" will print the backslash, while "Alt-Gr + /" will print the pipe. HTH.
Code:
keycode 98 = slash backslash bar
key <KPDV> { [ slash, backslash, bar ] };
Oh, and at least the pipe should already be mapped as "Alt-Gr + TLDE".
</Edit>
Regards,
Philip