Skip to content

Commit

Permalink
docs(KeyboardControls): fix wording/formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
andretchen0 committed Dec 25, 2024
1 parent 1d410b3 commit 5306864
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions docs/guide/controls/keyboard-controls.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,11 @@
* Arrow keys

::: info
:memo: KeyboardControls uses `PointerLockControls` under the hood, meaning you can use [all the props from `<PointerLockControls />`](pointer-lock-controls#props) as well as it events.
`<KeyboardControls />` uses `<PointerLockControls />` under the hood. You can use [`<PointerLockControls />` props and events](pointer-lock-controls#props).
:::

## Usage

You can use the ASDW or the arrows keys to move and your mouse to explore your scene.

```vue{3,10}
<script setup lang="ts">
import { TresCanvas } from '@tresjs/core'
Expand All @@ -34,18 +32,18 @@ import { KeyboardControls, Box } from '@tresjs/cientos'
```

::: warning
Is really important that the Perspective camera is set first in the canvas. Otherwise might break.
You must add a `<TresPerspectiveCamera />` to your scene before adding `<KeyboardControls />`.
:::

## Props

| Prop | Description | Default |
| :---------------------- | :----------------------------------- | ------- |
| **moveSpeed** | Speed movement. | 0.2 |
| **makeDefault** | If `true`, the controls will be set as the default controls for the scene. | `true` |
| **camera** | The camera to control. | `undefined` |
| **domElement** | The dom element to listen to. | `undefined` |
| **selector** | Accept an id element as string, if it is set, the new element will be used as the trigger | `undefined` |
| Prop | Description | Default |
| :-------------- | :----------------------------------- | ------- |
| **moveSpeed** | Speed movement. | 0.2 |
| **makeDefault** | If `true`, the controls will be set as the default controls for the scene. | `true` |
| **camera** | The camera to control. | `undefined` |
| **domElement** | The DOM element to listen to. | `undefined` |
| **selector** | Accept an id element as string. If set, the new element will be used as the trigger | `undefined` |

## Events

Expand All @@ -55,5 +53,5 @@ Is really important that the Perspective camera is set first in the canvas. Othe

| Event | Description |
| :--------- | :--------------------------------------------------------------- |
| **isLock** | Return `true` if "lock", `false` if "unlock" events are trigger. |
| **isLock** | Return `true` if "lock", `false` if "unlock" events are triggered. |
| **change** | Dispatched when the control changes. |

0 comments on commit 5306864

Please sign in to comment.