Rewrite the key assignment function to override default key