Updated keyboard shortcut handler