Improved keyboard control