-
-
Notifications
You must be signed in to change notification settings - Fork 4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Logitech MX Ink component docs and rename buttons to match Logite…
…ch docs
- Loading branch information
Showing
2 changed files
with
72 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
--- | ||
title: logiteck-mx-ink-controls | ||
type: components | ||
layout: docs | ||
parent_section: components | ||
source_code: src/components/logiteck-mx-ink-controls.js | ||
examples: [] | ||
--- | ||
|
||
[trackedcontrols]: ./tracked-controls.md | ||
|
||
The logiteck-mx-ink-controls component interfaces with the Logitech MX Ink tracked pen. It | ||
wraps the [tracked-controls component][trackedcontrols] while adding button | ||
mappings, events, and a pencil model. | ||
|
||
## Example | ||
|
||
```html | ||
<a-entity logiteck-mx-ink-controls="hand: left"></a-entity> | ||
<a-entity logiteck-mx-ink-controls="hand: right"></a-entity> | ||
``` | ||
|
||
## Value | ||
|
||
| Property | Description | Default Value | | ||
|----------------------|----------------------------------------------------|----------------------| | ||
| hand | The hand that will be tracked (i.e., right, left). | left | | ||
| model | Whether the Touch controller model is loaded. | true | | ||
|
||
## Events | ||
|
||
| Event Name | Description | | ||
| ---------- | ----------- | | ||
| tiptouchstart | Tip touched. | | ||
| tiptouchend | Tip no longer touched. | | ||
| tipchanged | Tip changed. | | ||
| frontdown | Front button pressed. | | ||
| frontup | Front button released. | | ||
| frontchanged | Front button changed. | | ||
| reardown | Rear button pressed. | | ||
| rearup | Rear button released. | | ||
| rearchanged | Rear button changed. | | ||
|
||
## Read tip changes | ||
|
||
Listen to the `tipchanged` event. | ||
|
||
```html | ||
<a-entity logiteck-mx-ink-controls="hand: left" tip-logging></a-entity> | ||
<a-entity logiteck-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 | ||
|
||
- [Logiteck MX Ink glTF](https://cdn.aframe.io/controllers/logitech/logitech-mx-ink.glb) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters