mudcube / Event.js

:hand: Multi-touch, gestures, and other events—click, dblclick, dbltap, tap, longpress, drag, swipe, pinch, rotate, shake. For pointer events, each listener can handle anywhere from 1 to 12 fingers at a time, or more, depending on the device. Includes MetaKey tracking (CMD, CTRL) to support native key-commands in various platforms.
MIT License
368 stars 68 forks source link

What is the units for wheelDelta, generated by the "wheel" events? #7

Closed stodge closed 10 years ago

stodge commented 10 years ago

What is the units for wheelDelta, generated by the "wheel" events? I'm trying to work out how to use the wheel to scale a map, which is scaled on mobile platforms using the "gesture" events.

mudcube commented 10 years ago

Follows the w3specs:

A number indicating the distance, measured as the number of "rolls" the wheel has been rotated. A positive value must indicate that the wheel has been rotated away from the user on vertically-aligned devices or in a left-hand manner on horizontally aligned devices, and a negative value must indicate that the wheel has been rotated towards the user on vertically-aligned devices or in a right-hand manner on horizontally aligned devices. The value of the wheelDelta must be the largest of the wheelDeltaX, wheelDeltaY, and wheelDeltaZ values. The default value of the wheelDelta attribute must be 0.

A "roll" is defined to be a unit of rotation. On some devices this is a finite physical step. On devices with smooth rotation, a "roll" becomes the smallest reported amount of rotation.

"Rotation" is defined to be an indication of incremental change. On some devices this is a literal rotation of a wheel, while on others, it may be movement along a flat surface, or pressure on a particular button.

stodge commented 10 years ago

Awesome - thanks.