Add some functions in key_events.js