[chimera-dev] PS3 controller

Tom Goddard goddard at sonic.net
Wed Apr 29 15:56:17 PDT 2015


Hi Matt,

  Here is the Mac spacenavigator C++ code used by Chimera

	http://plato.cgl.ucsf.edu/trac/chimera/browser/trunk/libs/_spacenavigator/spacenav.cpp <http://plato.cgl.ucsf.edu/trac/chimera/browser/trunk/libs/_spacenavigator/spacenav.cpp>

The Linux spacenavigator code instead uses the Python ctypes module to get events.

	http://plato.cgl.ucsf.edu/trac/chimera/browser/trunk/libs/SpaceNavigator/snavlinux.py <http://plato.cgl.ucsf.edu/trac/chimera/browser/trunk/libs/SpaceNavigator/snavlinux.py>

and the Windows spacenavigator code uses a Python COM interface to get the events.

	http://plato.cgl.ucsf.edu/trac/chimera/browser/trunk/libs/SpaceNavigator/snavwin32.py <http://plato.cgl.ucsf.edu/trac/chimera/browser/trunk/libs/SpaceNavigator/snavwin32.py>

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.

	Tom


> On Apr 29, 2015, at 12:56 PM, Dougherty, Matthew T wrote:
> 
> 
> I have written an extension that uses a PS3 game controller.
> 
> To make the hardware work and generate the keyboard accelerators text strings, I am using controllermate s/w on a Mac.
> 
> To make it work generically across platforms, like spacenav, I am going to have to write a driver that can load with chimera.
> 
> Any thoughts?
> Can you point me to the c code for spacenav?
> 
> Matthew Dougherty
> National Center for Macromolecular Imaging
> Baylor College of Medicine
> ===========================================================================
> _______________________________________________
> Chimera-dev mailing list
> Chimera-dev at cgl.ucsf.edu
> http://www.rbvi.ucsf.edu/mailman/listinfo/chimera-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://plato.cgl.ucsf.edu/pipermail/chimera-dev/attachments/20150429/34f6d0b3/attachment.html>


More information about the Chimera-dev mailing list