import { h, render, Component } from 'preact'; import {ResponsiveGamepad} from '../dist/responsive-gamepad.esm'; import ExamplePlugin from './examplePlugin'; import ResponsiveGamepadState from './state'; import Touchpad from './touchpad'; import './index.css'; // Log onInputsChange to console ResponsiveGamepad.onInputsChange( ResponsiveGamepad.RESPONSIVE_GAMEPAD_INPUTS.SELECT, state => { console.log('demo: onInputsChange SELECT! State:', state); } ); class ResponsiveGamepadDemo extends Component { componentDidMount() { ResponsiveGamepad.addPlugin(ExamplePlugin()); ResponsiveGamepad.enable(); } render() { return (
I am very tall to show off `event.preventDefault()`. E.g arrow keys wont scroll if in the keymap. But typing will work on input type form fields! Also, keyboard shortcuts will also still work (Refresh the page with Ctrl+R or Cmd+R)