This function outputs utf8 encoding of a key event or ansi code for everything it is applicable (arrows, ctrl+..., ...)