Back to Aframe

logitech-mx-ink-controls

docs/components/logitech-mx-ink-controls.md

1.7.12.0 KB
Original Source

The logitech-mx-ink-controls component interfaces with the Logitech MX Ink tracked pen. It wraps the tracked-controls component while adding button mappings, events, and a pencil model.

Example

html
<a-entity logitech-mx-ink-controls="hand: left"></a-entity>
<a-entity logitech-mx-ink-controls="hand: right"></a-entity>

Value

PropertyDescriptionDefault Value
handThe hand that will be tracked (i.e., right, left).left
modelWhether the Touch controller model is loaded.true

Events

Event NameDescription
tiptouchstartTip touched.
tiptouchendTip no longer touched.
tipchangedTip changed.
frontdownFront button pressed.
frontupFront button released.
frontchangedFront button changed.
reardownRear button pressed.
rearupRear button released.
rearchangedRear button changed.

Read tip changes

Listen to the tipchanged event.

html
<a-entity logitech-mx-ink-controls="hand: left" tip-logging></a-entity>
<a-entity logitech-mx-ink-controls="hand: right" tip-logging></a-entity>
javascript
AFRAME.registerComponent('tip-logging',{
  init: function () {
    this.el.addEventListener('tipchanged', this.tipChanged);
  },
  tipChanged: function (evt) {
    console.log("Pen tip changed");
  }
});

Assets