[chimera-dev] PS3 controller/Chimera2
Tom Goddard
goddard at sonic.net
Wed Apr 29 18:02:25 PDT 2015
I am using the same polling space navigator code in Chimera 2 which uses the wxWidgets window toolkit. Again the right approach would be to generate wx events, but there are too many other higher priority problems to solve in Chimera 2.
Tom
> On Apr 29, 2015, at 5:59 PM, Dougherty, Matthew T wrote:
>
> Hi Tom,
>
> How do you plan to implement spacenav into chimera2.
> Will you be using Tk?
>
> Matthew Dougherty
> National Center for Macromolecular Imaging
> Baylor College of Medicine
> ===========================================================================
> From: Tom Goddard
> Sent: Wednesday, April 29, 2015 5:56 PM
> To: Dougherty, Matthew T
> Cc: chimera-dev at cgl.ucsf.edu <mailto:chimera-dev at cgl.ucsf.edu>
> Subject: Re: [chimera-dev] PS3 controller
>
> 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 <mailto:Chimera-dev at cgl.ucsf.edu>
>> http://www.rbvi.ucsf.edu/mailman/listinfo/chimera-dev <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/f9fbb84b/attachment.html>
More information about the Chimera-dev
mailing list