[vtkusers] Proposed Changes to vtkRenderWindowInteractor

David Gobbi dgobbi at irus.rri.on.ca
Tue Sep 5 15:13:14 EDT 2000


On Tue, 5 Sep 2000, John Biddiscombe wrote:

> > 1) I've added 'OnKeyRelease' and 'OnKeyPress' virtual methods
> 
> >    I left in the old OnKeyUp and OnKeyDown methods, but I
> recommend
> 
> What's the difference?
> 
> JB

Here are the method prototypes, for comparison:

void OnKeyDown(int ctrl, int shift, char keycode, int repeatcount);
void OnKeyPress(int ctrl, int shift, char keychar, char *keysym, int rep);


Here are the differences, in a little more detail than my last email:
 
The OnKeyPress method receives a keysym string, which uses the same
set of descriptors as Tk e.g. "Insert", "Home", "Left", "a", etc.
The OnKeyPress 'keychar' is an ascii character, the same character
that is also sent to the OnChar method.

The OnKeyDown 'keycode' is a MS Windows Virtual Key Code, which is
really only meaningful on MS Windows (Yeah, I know there is some
overlap between virtual key codes and ASCII but not very much).
It is _not_ the same code that is sent to the OnChar method (except in
the case of digits or capital letters).

 - David
 
--
  David Gobbi, MSc                    dgobbi at irus.rri.on.ca
  Advanced Imaging Research Group
  Robarts Research Institute, University of Western Ontario






More information about the vtkusers mailing list