Home > three-story-controls > WheelAdaptor
Parse mouse wheel events and emit either dampened values, or trigger events for swipes that cross a given threshold.
Signature:
export declare class WheelAdaptor extends BaseAdaptor
Extends: BaseAdaptor
See WheelAdaptorProps for all properties that can be passed to the constructor. See WheelAdaptorDiscreteEvent and WheelAdaptorContinuousEvent for emitted event signatures.
Discrete adaptor
const wheelAdaptor = new WheelAdaptor({ type: 'discrete' })
wheelAdaptor.connect()
wheelAdaptor.addEventListener('trigger', (event) => {
cube.scale.y += event.y*0.1
})
Constructor | Modifiers | Description |
---|---|---|
(constructor)(props) | Constructs a new instance of the WheelAdaptor class |
Method | Modifiers | Description |
---|---|---|
connect() | ||
disconnect() | ||
isEnabled() | ||
update() |