Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accessibility #6

Open
Myrmod opened this issue Mar 15, 2022 · 0 comments
Open

Accessibility #6

Myrmod opened this issue Mar 15, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@Myrmod
Copy link
Owner

Myrmod commented Mar 15, 2022

I would love to have a way to be able to navigate scenes using the keyboard eg. via the tab key.

I am thinking about something like this:

<script lang="ts">
  type Box = {
    self: BABYLON.Mesh | BABYLON.AbstractMesh
  }
  let box1: Box
  let box2: Box
  let box3: Box
   
  $: tabableItems = [box1, box2, box3]  
</script>

<Canvas>
  <TabHandler items={tabableItems} cameraSpeed={1} outlineColor="#ffffff" outlineThickness={0.1} />
  <HemisphericLight />
  <ArcRotateCamera />
  <Box bind:object={box1} />
  <Box bind:object={box2} />
  <Box bind:object={box3} />
</Canvas>

The TabHandler component is then responsible for the following things:

  • checking if the received items are tabable
  • handling the keyboard events of the tab key in both directions
  • moving the camera smoothly to the focused object in a timely manner
  • highlighting the object with an outline

It might be required to be able to define a position the camera should move to on each object.

@Myrmod Myrmod added the enhancement New feature or request label Mar 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant