# Questions about interaction

**URL:** https://discourse.vtk.org/t/questions-about-interaction/10620
**Category:** Web
**Created:** [February 6, 2023, 7:10am UTC](https://discourse.vtk.org/t/questions-about-interaction/10620 "2023-02-06T07:10:10Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![HWsir](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/h/9dc877/32.png) [@HWsir](https://discourse.vtk.org/u/HWsir)
#### Post date: [February 6, 2023, 7:10am UTC](https://discourse.vtk.org/t/questions-about-interaction/10620/1 "2023-02-06T07:10:10Z")

</div>

I hope to display 3D images on the web side through trame, and set the interaction mode as “Up” with the keyboard, but there is no response. I want to know, once the images are transferred to the web side through trame, can I still set keyPress event

---

<div class="post-metadata">

### Author: ![Sebastien\_Jourdain](https://discourse.vtk.org/user_avatar/discourse.vtk.org/sebastien_jourdain/32/100_2.png) [@Sebastien\_Jourdain](https://discourse.vtk.org/u/Sebastien_Jourdain)
#### Post date: [February 6, 2023, 4:02pm UTC](https://discourse.vtk.org/t/questions-about-interaction/10620/2 "2023-02-06T16:02:26Z")

</div>

Can you share your code base? Is your question related to “how to bind keyboard events” with trame?

---

<div class="post-metadata">

### Author: ![HWsir](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/h/9dc877/32.png) [@HWsir](https://discourse.vtk.org/u/HWsir)
#### Post date: [February 7, 2023, 1:25am UTC](https://discourse.vtk.org/t/questions-about-interaction/10620/3 "2023-02-07T01:25:00Z")

</div>

Thank you for your answer, I’ve solved my interaction problems in other ways. But I also want to know why the keyPress event is no response. I only wrote the code using vtk’s keyboard binding, if I don’t use trame, the keyboard event is valid, if I do use trame, should I set trame’s keyboard binding, not vtk’s keyboard binding mode

---

<div class="post-metadata">

### Author: ![Sebastien\_Jourdain](https://discourse.vtk.org/user_avatar/discourse.vtk.org/sebastien_jourdain/32/100_2.png) [@Sebastien\_Jourdain](https://discourse.vtk.org/u/Sebastien_Jourdain)
#### Post date: [February 7, 2023, 3:17pm UTC](https://discourse.vtk.org/t/questions-about-interaction/10620/4 "2023-02-07T15:17:50Z")

</div>

When using trame, you have to forward user input to the server. `trame-vtk` does it by default with the mouse but not the keyboard. Ideally we should forward everything to VTK when it make sense but so far we let the application handle it.

So the keyboard binding needs to happen within your application (trame) and outside of VTK.

HTH

---

<div class="post-metadata">

### Author: ![HWsir](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/h/9dc877/32.png) [@HWsir](https://discourse.vtk.org/u/HWsir)
#### Post date: [February 8, 2023, 12:52am UTC](https://discourse.vtk.org/t/questions-about-interaction/10620/5 "2023-02-08T00:52:30Z")

</div>

Thank you for your answer. It helps me a lot. Good luck to you.

---

<div class="post-metadata">

### Author: ![boeboe26](https://discourse.vtk.org/user_avatar/discourse.vtk.org/boeboe26/32/7562_2.png) [@boeboe26](https://discourse.vtk.org/u/boeboe26)
#### Post date: [August 3, 2023, 9:30am UTC](https://discourse.vtk.org/t/questions-about-interaction/10620/6 "2023-08-03T09:30:43Z")

</div>

How to capture keyboard events in trame?

---

<div class="post-metadata">

### Author: ![Sebastien\_Jourdain](https://discourse.vtk.org/user_avatar/discourse.vtk.org/sebastien_jourdain/32/100_2.png) [@Sebastien\_Jourdain](https://discourse.vtk.org/u/Sebastien_Jourdain)
#### Post date: [August 3, 2023, 10:37pm UTC](https://discourse.vtk.org/t/questions-about-interaction/10620/7 "2023-08-03T22:37:42Z")

</div>

Please post your question on a new thread or directly on [Kitware/trame · Discussions · GitHub](https://github.com/Kitware/trame/discussions)
