# Move actor with keyboard arrow keys

**URL:** <https://discourse.vtk.org/t/move-actor-with-keyboard-arrow-keys/2045>\
**Category:** Development\
**Created:** [November 5, 2019, 9:40am UTC](https://discourse.vtk.org/t/move-actor-with-keyboard-arrow-keys/2045 "2019-11-05T09:40:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rai-sam](https://discourse.vtk.org/user_avatar/discourse.vtk.org/rai-sam/32/667_2.png) [@rai-sam](https://discourse.vtk.org/u/rai-sam)\
**Post date:** [November 5, 2019, 9:40am UTC](https://discourse.vtk.org/t/move-actor-with-keyboard-arrow-keys/2045/1 "2019-11-05T09:40:55Z")

</div>

How to move actor with keyboard arrow keys events?

vtkInteractorStyleTrackballActor is not suitable. vtkInteractorStyleFlight is broken.

I have implemented an observer with switch cases key codes VK\_LEFT, VK\_RIGHT, VK\_UP, VK\_DOWN. How to achieve movement forward, backward, left, right?

---

<div class="post-metadata">

**Author:** ![flaviu2](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/f/74df32/32.png) [@flaviu2](https://discourse.vtk.org/u/flaviu2)\
**Post date:** [November 6, 2019, 11:27am UTC](https://discourse.vtk.org/t/move-actor-with-keyboard-arrow-keys/2045/2 "2019-11-06T11:27:30Z")

</div>

I guess you have to use a timer beside you have already implemented which move the actor while user keep press arrow keys down. I didn’t do such a thing by now, but I guess will work like that.

---

<div class="post-metadata">

**Author:** ![archimedes](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/a/6de8d8/32.png) [@archimedes](https://discourse.vtk.org/u/archimedes)\
**Post date:** [October 3, 2020, 4:48pm UTC](https://discourse.vtk.org/t/move-actor-with-keyboard-arrow-keys/2045/3 "2020-10-03T16:48:02Z")

</div>

I will be using callbacks of Arrow key events to move the camera,  
and so fly around in my scene
