Implement a hook useKeyPress(targetKey, callback) that listens for keyboard events and triggers a callback when a specific key is pressed.
The hook should:
Example
let count = 0; useKeyPress("Enter", () => { count += 1; }); // Pressing "Enter" increases count
JavaScript Function
No test results yet
Click "Run" to execute tests