{"version":"1.0","type":"rich","title":"React component that handles pressed/released states for a single key on the keyboard.","description":"This example demonstrates a React component that tracks the pressed and released states of a single keyboard key, invoking callbacks for each event. It listens for both `keydown` and `keyup` events on the document, filtering out repeated key events and matching the specific key code. The component uses React’s `useEffect` hook to attach and clean up event listeners, and it returns `null` since it renders no visible output. The `KeyPressed` component accepts `keyCode`, `onPress`, and `onRelease` props to manage keyboard-driven interactions in a React application.","provider_name":"VizHub AI Studio","provider_url":"https://next.vizhub.com","html":"<iframe src=\"https://next.vizhub.com/viz/gist-7e6e9998fb2255685ae646da2637715a?mode=embed\" width=\"960\" height=\"500\" scrolling=\"no\" frameborder=\"1\"></iframe>","width":960,"height":500,"cache_age":3600}