Code for easy control keyboard in JavaScript