[PATCH to Xvnc] correctly position new KeySyms in kbdptr.c:KeySyms table

Vlad Harchev hvv "at" hippo.ru
Tue, 19 Sep 2000 21:30:31 +0000


On 18 Sep 2000, Tristan Richardson wrote:

 Hi Tristan,

 I've found a fix for the problem I was having with your patch.
 The following small patch should be applied over kbdptr.c patched with your
patch:

--- kbdptr.c-tr-orig	Wed Sep 20 01:05:15 2000
+++ kbdptr.c	Wed Sep 20 01:06:06 2000
@@ -333,7 +333,7 @@
 	    if (keySym == keySyms->map[i]) {
                keyCode = MIN_KEY_CODE + i / keySyms->mapWidth;
  
-               if (kbdMap[(i / keySyms->mapWidth) * keySyms->mapWidth + 1]
+               if (keySyms->map[(i / keySyms->mapWidth) * keySyms->mapWidth + 1]
                    != NoSymbol)
                {
                    /* this keycode has more than one symbol associated with

  I.e. you for some reason were using 'kbdMap' instead of 'keySyms->map'. Your
version of the patch didn't work because 'kbdMap[(i / keySyms->mapWidth) *
keySyms->mapWidth + 1]' contained NoSymbol in 10% of cases, which lead to not
setting shiftMustBeReleased or shiftMustBePressed.
 
 I was using vncviewer for X - used under Xfree86-3.3.3 on RedHat Linux 6.2.
 I hope this is a correct fix, and hope that your fixed patch will be
integrated into next Xvnc. 
 

> Vlad Harchev <hvv "at" hippo.ru> writes:
> > 
> >  I tried your variant and alas it doesn't work in all cases too with non-latin
> > characters (i.e., the problem I tried to solve with my patch appears in 10% of
> > keypresses when your patch is applied). That is, pressing a key when capslock
> > is active doesn't surround XKeyEvent with KeyEvent's for shift for some random
> > in this session keys (of course, the set of those offendind keys is the same
> > accross one Xvnc session, but differs between sessions). I tried to understand
> > the reason of this, but failed..
> >  So, something should be done with your variant of solution too :)
> 
> 
> Hi Vlad,
> 
> That's a shame - I tested it as much as I can, but without a genuine
> non-English keyboard it's difficult to do a thorough test :-(.  It seems odd
> that it only fails occasionally.  Can you give more information about the cases
> where it's failing?
> 
> Which platform & version of the viewer is being used?  It could be a bug in the
> viewer rather than the server.
> 
> You say that once it fails for a particular key, then it keeps failing for that
> session.  When this happens can you tell me which keysym it's supposed to be
> generating, and what X events (with keycode/keysym) it actual generates?  What
> does Xvnc print to stderr when it allocates a new keycode for that key?  Also
> the output of xmodmap -pk on the server would be really useful to know.  If you
> could put some debugging output in kbdptr.c to show what keysym the server is
> really getting from the viewer, that would be even better.
> 
> Thanks for your help,
> 
> Cheers
> 
> Tristan
> 

 Best regards,
  -Vlad
---------------------------------------------------------------------
To unsubscribe, send a message with the line: unsubscribe vnc-list
to majordomo "at" uk.research.att.com
See also: http://www.uk.research.att.com/vnc/intouch.html
---------------------------------------------------------------------