Add function for keyboard event (test in computer)