A module used to change the information of user action entered by various input devices such as touch screen or mouse into the logical virtual coordinates.
Added a new reactive property holding, available in vanilla and all frameworks.
holding returns true if at least one input is in progress, such as pressing a mouse button or pressing a key.
Example for react-axes
import React, { useEffect, useRef } from "react";
import { useAxes, PanInput } from "@egjs/react-axes";
export default function Demo() {
const { x, connect, holding } = useAxes(
{
x: {
range: [0, 360],
circular: true,
},
},
);
useEffect(() => {
connect("x", new PanInput("#area"));
}, []);
return (
<div id="area">
/* Do something with using {holding} */
</div>
);
};
Details
Added a new reactive property
holding
, available in vanilla and all frameworks.holding
returns true if at least one input is in progress, such as pressing a mouse button or pressing a key.Example for react-axes