Is there a reason the N with breve is a specific key? If you want to allow typing accented characters and other diacritics I'd suggest a "combine" modifier key. It would probably require a hardcoded table for the transformations, but the idea is that e.g. [Com] + ' + a : inserts á [Com] + ^ + e : inserts ê If that's not what you intended then never mind this I guess.