more reliable implementation of single key presses