Skip to content

Latest commit

 

History

History
47 lines (31 loc) · 1.69 KB

three-story-controls.wheeladaptor.md

File metadata and controls

47 lines (31 loc) · 1.69 KB

Home > three-story-controls > WheelAdaptor

WheelAdaptor class

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

Remarks

See WheelAdaptorProps for all properties that can be passed to the constructor. See WheelAdaptorDiscreteEvent and WheelAdaptorContinuousEvent for emitted event signatures.

Example

Discrete adaptor

const wheelAdaptor = new WheelAdaptor({ type: 'discrete' })
wheelAdaptor.connect()
wheelAdaptor.addEventListener('trigger', (event) => {
  cube.scale.y += event.y*0.1
})

Constructors

Constructor Modifiers Description
(constructor)(props) Constructs a new instance of the WheelAdaptor class

Methods

Method Modifiers Description
connect()
disconnect()
isEnabled()
update()