improved keyboard control