<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2719.2200" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2><FONT face="Times New Roman" size=3>Hi,<BR><BR>I
think I have a solution to the problem: (using CVS from 3 Sept). And its not
just with picking... its with all key bindings in a vtkTkRenderWidget<BR><BR>In
the vtkinteraction package (bindings.tcl), the Tcl events KeyPress
and<BR>KeyRelease are propagated both as a VTK CharEvent and as KeyPressEvent
or<BR>KeyReleaseEvent :<BR> $iren
SetEventInformationFlipY $x $y $ctrl $shift $keysym 0
$keysym<BR> $iren
Key${event}Event<BR> $iren
SetEventInformationFlipY $x $y $ctrl $shift $keysym 0
$keysym<BR> $iren
CharEvent<BR><BR>Since vtkInteractorStyle and vtkInteractorStyleSwitch don't
implement<BR>OnKeyPress() or OnKeyRelease the duplication doesn't matter. But
when you<BR>press and release a key in vtkTkRenderWidget two CharEvents are
triggered<BR>and OnChar() is called twice.<BR><BR>One easy solution/work around
is in Tcl:<BR><BR>bind $vtkw <KeyPress> { }; # there's a space between the
brackets<BR><BR>This just disables the binding for KeyPress so just KeyRelease
will call<BR>OnChar() once.<BR><BR>Alternatively, vtkInteractorStyle.cxx can be
changed by renaming<BR>vtkInteractorStyle::OnChar() to
vtkInteractorStyle::OnKeyRelease(). So....<BR><BR>line860 changes from<BR>void
vtkInteractorStyle::OnChar()<BR><BR>to<BR>void
vtkInteractorStyle::OnKeyRelease<BR><BR>and change vtkInteractorStyle.h
accordingly<BR><BR>virtual void OnChar(); --> virtual void OnChar()
{};<BR>virtual void OnKeyRelease() {}; --> virtual void
OnKeyRelease();<BR><BR>I'd be gratefull if someone could have a look at
this,<BR><BR>Goodwin<BR><BR><BR>----- Original Message -----<BR>From: "Goodwin
Lawlor" <</FONT><A href="mailto:goodwin.lawlor@ucd.ie"><FONT
face="Times New Roman" size=3>goodwin.lawlor@ucd.ie</FONT></A><FONT
face="Times New Roman" size=3>><BR>To: "VTK" <</FONT><A
href="mailto:vtkusers@public.kitware.com"><FONT face="Times New Roman"
size=3>vtkusers@public.kitware.com</FONT></A><FONT face="Times New Roman"
size=3>><BR>Sent: Tuesday, September 03, 2002 6:57 PM<BR>Subject: Re:
[vtkusers] Bug with picking in a vtkTkRenderWidget<BR><BR><BR>> Actually the
problem is that one "pick" is performed when you press the<BR>"p"<BR>> key
and another when you release the "p" key... any ideas where in the<BR>>
source code this could be corrected?<BR>><BR>> Thanks,<BR>>
Goodwin<BR>> University College Dublin<BR>> ----- Original Message
-----<BR>> From: "Goodwin Lawlor" <</FONT><A
href="mailto:goodwin.lawlor@ucd.ie"><FONT face="Times New Roman"
size=3>goodwin.lawlor@ucd.ie</FONT></A><FONT face="Times New Roman"
size=3>><BR>> To: "VTK" <</FONT><A
href="mailto:vtkusers@public.kitware.com"><FONT face="Times New Roman"
size=3>vtkusers@public.kitware.com</FONT></A><FONT face="Times New Roman"
size=3>><BR>> Sent: Tuesday, September 03, 2002 6:08 PM<BR>> Subject:
[vtkusers] Bug with picking in a vtkTkRenderWidget<BR>><BR>><BR>> >
Hi All,<BR>> ><BR>> > There seems to be a bug when picking in a
vtkTkRenderWidget with vtk4.x.<BR>> For<BR>> > every one "p" key-press,
there are two PickEvents being triggered (and I<BR>> > think two Pick
commands being performed). It could be I have<BR>misunderstood<BR>> >
something with the new way of handling Tcl events in vtk4.x - I'd be<BR>>
> gratefull if you could point me in the right direction.<BR>>
><BR>> > My setup: WinXP/bcc32/cvs-28Aug2002<BR>> ><BR>> >
Attached is an example Tcl script to illustrate the problem. Just
run<BR>the<BR>> > script and press "p" a couple of times in the
RenderWindow.<BR>> ><BR>> > Thanks,<BR>> ><BR>> >
Goodwin<BR>> > University College Dublin<BR>> ><BR>><BR>>
_______________________________________________<BR>> This is the private VTK
discussion list.<BR>> Please keep messages on-topic. Check the FAQ
at:<BR><</FONT><A href="http://public.kitware.com/cgi-bin/vtkfaq"><FONT
face="Times New Roman"
size=3>http://public.kitware.com/cgi-bin/vtkfaq</FONT></A><FONT
face="Times New Roman" size=3>><BR>> Follow this link to
subscribe/unsubscribe:<BR>> </FONT><A
href="http://public.kitware.com/mailman/listinfo/vtkusers"><FONT
face="Times New Roman"
size=3>http://public.kitware.com/mailman/listinfo/vtkusers</FONT></A><BR><BR><BR><BR></FONT></DIV></BODY></HTML>