xmodmap patch to vnc 3.3.3 (interesting discoveries!)

Marius Kotsbak marikots "at" stud.aitel.hist.no
Sat, 23 Mar 2002 13:50:12 +0000


Thank you !-) Using your script (with "any") it actually works :-)

The only question I have then is how to map the uppercase oslash
(Oobliqe I think) to uppercase 'S' (this is the official mapping of
norw. dvorak):

 94         0x00f8 (oslash) 0x00d8 (Ooblique)

With your proposal it looks like lowercase aring key gives uppercase S
(uppercase Aring gives uppercase Aring). By running xmodmap -e 'keysym
aring = s S aring Aring' and "xmodmap -e 'keycode any = s S aring
Aring'" (Aring is uppercase aring), both lower and uppercase maps to
uppercase S, but I want it to map to the same case.

I have no more ideas of how to do this. (I don't follow your explanation
of how X mapper works fully, as I haven't programmed it before).

Another point is that if it is possible, vnc should manage the
internationally keys automatically (like it does when not remapping). It
also works when mapping locally (with works with linux, but in windoze
unfortunalely requires both patching of keymapping-files and
admin-access). I also assume other keymappings
, as French, German etc. have the same problem (for dvorak-users).

BTW, are you developing on vnc or just patching it?

Thanks for your help on this issue.

Marius K


 
On fre, 2002-03-22 at 20:47, Grant McDorman wrote:
> (writing from home since I'm off work today)
> 
> (part 1, mapping events, and part 2, w/o mapping events)
> 
> The mapping events are entirely expected and reasonable. Note that it starts 
> with keycode 89 - the first free Xvnc keycode.
> 
> (part 3, xmodmap -pk)
> 
> Looks fine. The keys pressed in part 1 are added just as the mapping events 
> described.
> 
> (part 4, xmodmap -e "keysym aring = s")
> 
> The result is correct. However, given the way Xvnc works, this simply 
> *removes* the aring keymapping. Better would be:
>   xmodmap -e "keysym aring = s S aring"
> 
> (part  5, press aring after the above xmodmap)
> 
> Exactly the way I expected. Xvnc doesn't find a keymap entry somewhere 
> containing aring, so it creates a new one.
> 
> (part 6, mapping oslash)
> 
> Xvnc uses the first entry it finds containing the keysym.
> 
> Try:
>   xmodmap -e 'keycode 89 = s S aring"
> This will, unfortunately, destroy whatever's at entry 89, but Xvnc is 
> guaranteed to use it.
> 
> Don't use this as the final version, though; you run the risk of it breaking 
> if a new release of Xvnc has a static entry for keycode 89.
> 
> Alternatively, use this script fragment:
>   if ! xmodmap -e 'keysym aring = s S aring' ; then 
>    xmodmap -e 'keycode 127 = s S aring'
>   fi
> 
> This will redefine any existing entry; if that fails (presumably because there 
> is no existing entry) a new entry will be created. Of course, you must use a 
> unique number for each key (e.g. 127 for aring, 128 for oslash, etc.)
> 
> In more recent versions of xmodmap, you can use 'any' instead of '127' above, 
> and xmodmap will use the first empty entry; that is:
>   xmodmap -e 'keycode any = s S aring'
> 
> Unless you use the script fragment, the mapping trick must be done before the 
> key has been pressed; if there are duplicate entries it probably won't work, 
> as the first entry is likely to be the generated entry and not the "trick" 
> entry. The script fragment should handle any case.
> 
> A special case to watch for is when you have another key you want to act as 
> aring (or oslash or ...). Make sure that the entry for that second key is 
> *after* the entry for the _real_ aring (oring...) key. Specifically,
>   127 0x0073 (s) 0x0053 (S) 0x00e5 (aring)
>   128 0x00e5 (aring) 0x00c5 (Aring) 0x00?? (somekey)
> will work but the reverse:
>   127 0x00e5 (aring) 0x00c5 (Aring) 0x00?? (somekey)
>   128 0x0073 (s) 0x0053 (S) 0x00e5 (aring)
> will not, since the server will find entry #127 first.
> 
> On March 22, 2002 12:21 pm, you wrote:
> > (this might have been sent before, but I send it again as I didn't
> > receive my post)
> >
> > I have attatched my findings, like you requested and more.
> >
> > On Thu, 2002-03-21 at 17:30, Grant McDorman wrote:
> > > According to Marius Kotsbak:
> > > Send me the result of this and we'll take it from there.
> > >
> 
> 
> -- 
> Grant McDorman <grmcdorman "at" netscape.net>
---------------------------------------------------------------------
To unsubscribe, mail majordomo "at" uk.research.att.com with the line:
'unsubscribe vnc-list' in the message BODY
See also: http://www.uk.research.att.com/vnc/intouch.html
---------------------------------------------------------------------