INNER CODE UNIT · TypeScript
onWheel
okasi/bot-signal · src/behavioral/index.ts:144
const onWheel = (event: Event): void => {
const wheelEvent = event as WheelEvent;
record<ScrollSample>(samples.scrolls, {
deltaY: wheelEvent.deltaY,
t: Date.now(),
isTrusted: wheelEvent.isTrusted,
});
};
const onKeyDown = (event: Event): void => {
const keyboardEvent = event as KeyboardEvent;
record<KeySample>(samples.keyPresses, {
t: Date.now(),
isTrusted: keyboardEvent.isTrusted,
repeat: keyboardEvent.repeat,
});
};