Insert unicode character that's not in the standard keyboard layout



I need to insert (in contacts, SMS) some special accented characters (Latvian) that are not available from the default soft keyboard (ie, when I hold down the base character key and get the list of accented characters). The phone model I have is HTC Desire.

So, how can I do it? One way could be somehow configuring the default keyboard (ie, add one more character to certain accented characters sub-list), but I don't see any fine-level control that would be accessible from the standard settings.

Another way could be installing alternative soft keyboard that has this fine-level control.

I am totally new to Android, but I use Linux daily, so I am not afraid to go and run console commands or anything, if needed.