Fix keyboard shortcuts

When the function doesn't return false the keypress is passed to the browser
which shouldn't happen.