<pre class="prettyprint">
document.addEventListener("rotarydetent", function(ev)
{
- var direction = ev.detail.direction;
- /* Add behavior for detent detected event with a direction value */
+ /* Get direction value from event */
+ var direction = ev.detail.direction;
+
+ if (direction == "CW")
+ {
+ /* Add behavior for clockwise rotation */
+ console.log("clockwise");
+ }
+ else if (direction == "CCW")
+ {
+ /* Add behavior for counter-clockwise rotation */
+ console.log("counter-clockwise");
+ }
});
</pre>
<th class="note">Note</th>
</tr>
<tr>
- <td class="note">This feature is supported in wearable applications only.</td>
+ <td class="note">This feature is supported in wearable applications only.<p>The web service application is OPTIONAL feature, which means that it may not be supported in all wearable devices.</td>
</tr>
</tbody>
</table>