The answer depends on whether you are running X (a current generation gui desktop) or not. You didn't specify.
Running X:
There are several ways to handle this.
The most precise/limited way is to use xmodmap
. I haven't used it, so I'm not familiar with the details. It will remap keys with specific key codes to specific key symbols.
If you have trouble sorting things out, run xev
. When you press any key combination (or do other X things), xev
will tell you what the system saw which will give you the values you need for xmodmap
.
Once you get the command to work, you can run it from your ~/.login
script so it's there when you start an interactive shell. Or, you can add it as a bash script into your desktop environment's autostart system.
If you want to do more, you may want to check out AutoKey
which is a desktop automation tool. Among other things, you can define a macro which will be triggered by a simple or compound keypress which can do anything from just emitting another keypress to running a complex macro coded in Python which can do almost anything you can think of - if you know enough Python.
I use it every day and love it.
For simpler things along the same lines, check out xdotool
. It can also do a few things which AutoKey
currently can't do - like emit mouse events.
Not running X (server installation, etc.):
This is a lot harder to find information on because it's a much less common case.
I've never tried it, but I did find some information on it here yesterday answering another question.