<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi Matt,<div class=""><br class=""></div><div class=""> Here is the Mac spacenavigator C++ code used by Chimera</div><div class=""><br class=""></div><div class=""><span class="Apple-tab-span" style="white-space:pre"> </span><a href="http://plato.cgl.ucsf.edu/trac/chimera/browser/trunk/libs/_spacenavigator/spacenav.cpp" class="">http://plato.cgl.ucsf.edu/trac/chimera/browser/trunk/libs/_spacenavigator/spacenav.cpp</a></div><div class=""><br class=""></div><div class="">The Linux spacenavigator code instead uses the Python ctypes module to get events.</div><div class=""><br class=""></div><div class=""><span class="Apple-tab-span" style="white-space:pre"> </span><a href="http://plato.cgl.ucsf.edu/trac/chimera/browser/trunk/libs/SpaceNavigator/snavlinux.py" class="">http://plato.cgl.ucsf.edu/trac/chimera/browser/trunk/libs/SpaceNavigator/snavlinux.py</a></div><div class=""><br class=""></div><div class="">and the Windows spacenavigator code uses a Python COM interface to get the events.</div><div class=""><br class=""></div><div class=""><span class="Apple-tab-span" style="white-space:pre"> </span><a href="http://plato.cgl.ucsf.edu/trac/chimera/browser/trunk/libs/SpaceNavigator/snavwin32.py" class="">http://plato.cgl.ucsf.edu/trac/chimera/browser/trunk/libs/SpaceNavigator/snavwin32.py</a></div><div class=""><br class=""></div><div class="">Each of these allow Chimera to get the most recent Space Navigator position before each frame is drawn using the Chimera “new frame” trigger. This technique for processing the events is called “polling” and is bad. The right way to do it would be to get the space navigator events when they occur and put them in the Tk event queue so they are handled when Chimera processes the Tk event queue. That is how Chimera gets mouse and keyboard events. I didn’t do that because the integration with the Tk window toolkit is harder.</div><div class=""><br class=""></div><div class=""><span class="Apple-tab-span" style="white-space:pre"> </span>Tom</div><div class=""><br class=""></div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Apr 29, 2015, at 12:56 PM, Dougherty, Matthew T wrote:</div><br class="Apple-interchange-newline"><div class="">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" class="">
<div class="">
<br class="">
I have written an extension that uses a PS3 game controller.<br class="">
<br class="">
To make the hardware work and generate the keyboard accelerators text strings, I am using controllermate s/w on a Mac.<br class="">
<br class="">
To make it work generically across platforms, like spacenav, I am going to have to write a driver that can load with chimera.<br class="">
<br class="">
Any thoughts?<br class="">
Can you point me to the c code for spacenav?<br class="">
<br class="">
Matthew Dougherty<br class="">
National Center for Macromolecular Imaging<br class="">
Baylor College of Medicine<br class="">
===========================================================================
</div>
_______________________________________________<br class="">Chimera-dev mailing list<br class=""><a href="mailto:Chimera-dev@cgl.ucsf.edu" class="">Chimera-dev@cgl.ucsf.edu</a><br class="">http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-dev<br class=""></div></blockquote></div><br class=""></div></body></html>