filter UI keyboard events depending on displaymode and popupmsg