added UI context states; added keypress call
fixed bug in insertChar; draw text with underline element