remove duplicate HandleKeyDown logic