<br>I have this issue with VTK that is compiled for Cocoa.  It appears this fix is only for CARBON, right?<br><br>Best, Darren<br><br><br><div class="gmail_quote">On Thu, Mar 19, 2009 at 4:09 PM, Michael Jackson <span dir="ltr">&lt;<a href="mailto:mike.jackson@bluequartz.net">mike.jackson@bluequartz.net</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">These are from my own notes about the render window not getting the key events.. or maybe it was the mouse events:<br>

<br>
<br>
I recently moved up to Leopard and this is now hitting me also so I went looking around and here is the solution that I came up with and it would seem to work all the way back to Panther (10.3.x). This is probably ONLY necessary if you build VTK with Carbon instead of Cocoa. You would build against Carbon in the following Situations:<br>

  * You will be using Qt versions 4.0 through at least Qt 4.4<br>
  * You are using another toolkit that requires Carbon?<br>
  * You are building ParaView 3.2 or probably ParaView 3.4 (which uses Qt 4.3/Qt 4.4)<br>
<br>
I added the following code to my &quot;main&quot; method:<br>
<br>
In your “main” method have the following:<br>
<br>
#ifdef __APPLE__ &amp;&amp; defined (VTK_USE_CARBON)<br>
#include &lt;Processes.h&gt;<br>
void Apple_Carbon_Focus_Fix()<br>
{<br>
  ProcessSerialNumber psn = { 0, kCurrentProcess };<br>
  OSErr err = GetCurrentProcess (&amp;psn);<br>
  OSStatus status =  TransformProcessType ( &amp;psn, kProcessTransformToForegroundApplication);<br>
}<br>
#else<br>
void Apple_Carbon_Focus_Fix()<br>
{<br>
}<br>
#endif<br>
<br>
// ----------------------------------------------<br>
int main(int argc, char* argv[])<br>
{<br>
<br>
  Apple_Carbon_Focus_Fix();<br>
<br>
  return 0;<br>
}<br>
<br>
<br>
Then in your CMakeLists.txt file have the following (VTK is used as the example)<br>
# This must be AFTER the VTK package has been found....<br>
IF (APPLE AND VTK_USE_CARBON)<br>
       # We must include this header directory in order to use some carbon specific calls<br>
       INCLUDE_DIRECTORIES(&quot;/Developer/Headers/FlatCarbon&quot;)<br>
END IF (APPLE AND VTK_USE_CARBON)<br>
<br>
<br>
_________________________________________________________<br>
Mike Jackson                  <a href="mailto:mike.jackson@bluequartz.net" target="_blank">mike.jackson@bluequartz.net</a><br>
BlueQuartz Software                    <a href="http://www.bluequartz.net" target="_blank">www.bluequartz.net</a><br>
Principal Software Engineer                  Dayton, Ohio<div><div></div><div class="h5"><br>
<br>
<br>
<br>
On Mar 19, 2009, at 7:03 PM, Sean McBride wrote:<br>
<br>
</div></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div></div><div class="h5">
On 3/19/09 3:58 PM, Darren Weber said:<br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I&#39;m not yet versed in Cocoa to make the change required.  I can follow<br>
specific instructions...  I wonder if the keyboard event capture should<br>
apply at the level of the window or at the level of the interactor?<br>
</blockquote>
<br>
The snippit you had was good (wrong header though), so just paste it<br>
into the vtkCocoaRenderWindowInteractor constructor:<br>
<br>
#include &lt;ApplicationServices/ApplicationServices.h&gt;<br>
<br>
ProcessSerialNumber psn = { 0, kCurrentProcess };<br>
OSStatus error = TransformProcessType( &amp;psn,<br>
kProcessTransformToForegroundApplication );<br>
assert (error == noErr);<br>
<br>
-- <br>
____________________________________________________________<br>
Sean McBride, B. Eng                 <a href="mailto:sean@rogue-research.com" target="_blank">sean@rogue-research.com</a><br>
Rogue Research                        <a href="http://www.rogue-research.com" target="_blank">www.rogue-research.com</a><br>
Mac Software Developer              Montréal, Québec, Canada<br>
<br>
<br></div></div>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
</blockquote>
<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
</blockquote></div><br>