From your comment:
basically this is a "machine" that transforms the input text into a colorful image. so each letter has a image that it is represented by. I want that the user while writing already sees how it looks like. I am on each keyup reading the data of the textfield and then adding the last letter as an image to my big image. but the shift-button disturbs things...
Would it be too much to rebuild the entire design from scratch every time on keyup? Each time a keyup event is received, wipe away the current image, and loop through each character of the textfield to add its image.
$(document).keyup(function (e) {
// Do whatever you need to do to clear the image…
var myText = $("#postcardText").val();
for (var i = 0; i < myText.length; i++) {
var thisChar = myText.charAt(i);
// Add thisChar to the image…
addLetter(thisChar);
}
});
This method has the added benefit that you can handle arrow keys and even deletions without having to write in exceptions for each of those cases.