# How about interactor using

**URL:** https://discourse.vtk.org/t/how-about-interactor-using/4730
**Category:** Support
**Created:** [November 25, 2020, 2:52am UTC](https://discourse.vtk.org/t/how-about-interactor-using/4730 "2020-11-25T02:52:49Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![DL\_men](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/d/43a26b/32.png) [@DL\_men](https://discourse.vtk.org/u/DL_men)
#### Post date: [November 25, 2020, 2:52am UTC](https://discourse.vtk.org/t/how-about-interactor-using/4730/1 "2020-11-25T02:52:49Z")

</div>

vtk.vtkInteractorStyleRubberBandPick  
This interactor style allows the user to draw a rectangle in the render window by hitting ‘r’ .How can I do event(draw a rectangle) withou hitting ‘r’?

---

<div class="post-metadata">

### Author: ![Joachim\_P](https://discourse.vtk.org/user_avatar/discourse.vtk.org/joachim_p/32/3272_2.png) [@Joachim\_P](https://discourse.vtk.org/u/Joachim_P)
#### Post date: [November 25, 2020, 10:00pm UTC](https://discourse.vtk.org/t/how-about-interactor-using/4730/2 "2020-11-25T22:00:53Z")

</div>

Hi,  
You can call the method `StartSelect()` on your `vtkInteractorStyleRubberBandPick` and it will programmatically switch the interactor in selection mode.  
Hope this helps,  
J.

---

<div class="post-metadata">

### Author: ![DL\_men](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/d/43a26b/32.png) [@DL\_men](https://discourse.vtk.org/u/DL_men)
#### Post date: [November 26, 2020, 6:31am UTC](https://discourse.vtk.org/t/how-about-interactor-using/4730/3 "2020-11-26T06:31:28Z")

</div>

Thanks. It works well.

---

<div class="post-metadata">

### Author: ![DL\_men](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/d/43a26b/32.png) [@DL\_men](https://discourse.vtk.org/u/DL_men)
#### Post date: [November 26, 2020, 8:13am UTC](https://discourse.vtk.org/t/how-about-interactor-using/4730/4 "2020-11-26T08:13:30Z")

</div>

Excuseme. But how to end with this selection mode?

---

<div class="post-metadata">

### Author: ![Joachim\_P](https://discourse.vtk.org/user_avatar/discourse.vtk.org/joachim_p/32/3272_2.png) [@Joachim\_P](https://discourse.vtk.org/u/Joachim_P)
#### Post date: [November 26, 2020, 10:52am UTC](https://discourse.vtk.org/t/how-about-interactor-using/4730/5 "2020-11-26T10:52:26Z")

</div>

Looks like the implementation is not finished to address this specific case.  
An alternative is to simulate the press of the ‘r’ key on your `vtkRenderWindowInteractor` instance like this:

```auto
  iren->SetKeyCode('r');
  iren->InvokeEvent(vtkCommand::CharEvent, nullptr); 

```

---

<div class="post-metadata">

### Author: ![DL\_men](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/d/43a26b/32.png) [@DL\_men](https://discourse.vtk.org/u/DL_men)
#### Post date: [November 30, 2020, 1:14am UTC](https://discourse.vtk.org/t/how-about-interactor-using/4730/6 "2020-11-30T01:14:26Z")

</div>

Thanks.I use pyautogui to imitate pressing ‘r’ to stop selection mode .Maybe it’s not good enough.
