Although this can come as a shock to many, you can use the built-in trap trapfor traps :-)
Well, at least those that can be captured, but CTRL-C is usually attached to the signal INT. You can capture signals and execute arbitrary code.
script , . , INT, :
#!/bin/bash
exitfn () {
trap SIGINT
echo; echo 'Aarghh!!'
exit
}
trap "exitfn" INT
read -p "What? "
echo "You said: $REPLY"
trap SIGINT
( , CTRL-C CTRL-C):
pax> ./testprog.sh
What? hello there
You said: hello there
pax> ./testprog.sh
What? ^C
Aarghh!!
pax> ./qq.sh
What? incomplete line being entere... ^C
Aarghh!!