Added function keys event handler to js