Skip to content

Latest commit

 

History

History

useKeyDown

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

useKeyDown

Returns a callback function to handle key down events for specified keys.

Usage

const Usage = () => {
  const handleAction = () => {
    ...
  };

  const onKeyDown = useKeyDown({ action: handleAction });

  return (
    <div onKeyDown={onKeyDown} />
  );
};