sup friend, on my side i contrôle mouse frequency update like this for some of my inputs.
<button
style={{ cursor: 'w-resize' }}
onPointerDown={(e) => {
const { min, max, step, speed } = metas ?? {}; // metas options of the input
const sdx = (e.clientX - e.clientY);
const pointermove = (e: PointerEvent) => {
const dx = (e.clientX - e.clientY);
let v = value + ((dx - sdx) * (speed ?? 0.5)); // speed of mouse 🟢
if (step) v = Math.round(v / step) * step; // apply step if need
if (min !== undefined) v = Math.max(min, v); // apply clamping
if (max !== undefined) v = Math.min(max, v);
v = +v.toFixed(3);
setValue(v);
onChange?.(v);
};
document.addEventListener('pointermove', pointermove);
document.addEventListener('pointerup', (e) => document.removeEventListener('pointermove', pointermove), { once: true });
e.stopPropagation();
e.preventDefault();
}}
>
{`${vkey}:`}
</button>
did you or can you expose a way to allow user hack mouse speed/frequency ?
1 pixel update is too face for lot of case.
can you guide how archive this with your api ?
related to this issu, thanks
0b5vr/tweakpane-plugin-rotation#1
You mean you want to change a scale for dragging, right?
In the current spec it's estimated from its initial value or step
option.
tweakpane/packages/core/src/common/util.ts
Lines 118 to 126 in 4f5175b
Owner Name | cocopon |
Repo Name | tweakpane |
Full Name | cocopon/tweakpane |
Language | TypeScript |
Created Date | 2016-05-10 |
Updated Date | 2023-03-17 |
Star Count | 2603 |
Watcher Count | 19 |
Fork Count | 71 |
Issue Count | 11 |
Issue Title | Created Date | Updated Date |
---|