<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Jun 16, 2016 at 6:32 AM, Elvis Stansvik <span dir="ltr"><<a href="mailto:elvis.stansvik@orexplore.com" target="_blank">elvis.stansvik@orexplore.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span class="">2016-06-16 14:12 GMT+02:00 David Gobbi <span dir="ltr"><<a href="mailto:david.gobbi@gmail.com" target="_blank">david.gobbi@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi Elvis,<div><br></div><div>The commit logs might hold the answers to some of your questions.</div><div><br></div><div>Here's the history line for when QVTKRenderWindowInteractor.py was created:</div><div><a href="https://gitlab.kitware.com/vtk/vtk/commits/720b580c/Wrapping/Python/vtk/qt/QVTKRenderWindowInteractor.py" target="_blank">https://gitlab.kitware.com/vtk/vtk/commits/720b580c/Wrapping/Python/vtk/qt/QVTKRenderWindowInteractor.py</a><br></div><div><br></div><div>The history continues here:</div><div><a href="https://gitlab.kitware.com/vtk/vtk/commits/3f70e5ff/Wrapping/Python/vtk/qt4/QVTKRenderWindowInteractor.py" target="_blank">https://gitlab.kitware.com/vtk/vtk/commits/3f70e5ff/Wrapping/Python/vtk/qt4/QVTKRenderWindowInteractor.py</a><br></div><div><br></div><div>And finally comes to the present:</div><div><a href="https://gitlab.kitware.com/vtk/vtk/commits/master/Wrapping/Python/vtk/qt/QVTKRenderWindowInteractor.py" target="_blank">https://gitlab.kitware.com/vtk/vtk/commits/master/Wrapping/Python/vtk/qt/QVTKRenderWindowInteractor.py</a><br></div><div class="gmail_extra"><br><div class="gmail_quote">Also, here is some pre-history:</div><div class="gmail_quote"><a href="https://gitlab.kitware.com/vtk/vtk/commits/bae05540/Wrapping/Python/QVTKRenderWidget.py" target="_blank">https://gitlab.kitware.com/vtk/vtk/commits/bae05540/Wrapping/Python/QVTKRenderWidget.py</a></div><div class="gmail_quote"><a href="https://gitlab.kitware.com/vtk/vtk/tree/5b48ce33/Wrapping/Python" target="_blank">https://gitlab.kitware.com/vtk/vtk/tree/5b48ce33/Wrapping/Python</a><span><font color="#888888"><br></font></span></div><span><font color="#888888"><div class="gmail_quote"><br></div></font></span></div></div></blockquote><div><br></div></span><div>Thanks for the pointers, but it seems the code was like that when the Qt 4 variant was initially contributed by Phil Thomson:<br><br>    <a href="https://gitlab.kitware.com/vtk/vtk/commit/720b580c32b1ab002572fa59d796e409b5b0c346" target="_blank">https://gitlab.kitware.com/vtk/vtk/commit/720b580c32b1ab002572fa59d796e409b5b0c346</a></div></div></div></div></blockquote><div><br></div><div>Wrong.  You might need to practice your detective skills some more :)</div><div><br></div><div><div><a href="https://gitlab.kitware.com/vtk/vtk/commit/0ab4f15f">https://gitlab.kitware.com/vtk/vtk/commit/0ab4f15f</a></div></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>But even if we forget about history/origin, doesn't it seem strange to use <span><span>str</span><span>(</span><span>ev</span><span>.</span><span>text</span><span>()) in the keyPressEvent?</span></span></div></div></div></div></blockquote><div><br></div><div>Yes, it seems strange, but there might be a reason.  You'll have to experiment with Qt to see what str(ev.text()) and chr(ev.key()) return under various situations.</div><div><br></div><div> - David</div><div> </div></div><br></div></div>