Provide utility function for keyboard input detection