[FreeNX-kNX] setxkbmap on MacOSX

jhonyl jhonyl at netscape.net
Sat Oct 11 02:18:51 UTC 2008


To make a long story short: Problem solved ! See fix at bottom.
--------------------------------------------------
I have contacted NoMachine about their test drive and have got the
following reply:

"Keyboard extension requests are disabled when the connecting client
is MacOS. This is because the AppleX11 software has a completely
different set of key codes than X11 on Linux. If we allowed you to
change keyboard inside Gnome/KDE, you would get a completely
broken keyboard."

What do you think?

Well... I was thinking that if it is disabled by NoMachine, then
maybe if I make the server think that my client is not a macosx
but a linux then it will work. So I found the place in nxserver
where it recieves the client type, and change it but it didn't help
one bit. So I started to wonder about other things like 'pstree
-pu nx' and wondered where is nxagent in that tree? It isn't there
so I 'ps aux|grep nxagent' and saw lots of processes with their
argument list, but non of them had a client arguement, and
on the other hand they had a '-keyboard pc102/en_US', all except
my macosx session, that had '-keyboard query'. So I thought
maybe that is the problem? So I went back to the place where
I have changed the command in nxserver and replaced also query
with macintosh_old, and now the keyboard works, and is
switching languages. Still it have a few minor problems like the
arrows but that is easy to fix. I found my old xmodmap file, and
ran it, and it brought back the arrows. A better solution, I think, 
would
be to define a new keyboard in xkb, and to call it macintosh_nxosx.


Here is the code between the #IAddedThis:

-------From--nxserver---------

# Session stage
while true
do
    echo_x -n "NX> 105 "
    unset CMD
    read CMD 2>/dev/null
    # FIXME?
    [ "$CMD" = "" ] && CMD="quit"

#IAddedThis(
        if stringinstring "macosx" "$CMD" ;
        then
                CMD=${CMD/query/macintosh_old}
#                echo_x "Jhonyl>nxserver> Replaced macosx keyboard. Now 
CMD=$CMD"
#        else
#                echo_x "Jhonyl>nxserver> Not a macosx. CMD=$CMD"
        fi
#IAddedThis)

    # Logging
    case "$CMD" in
        startsession*|restoresession*|addmount*|addprinter*)
            echo_secure "$CMD"
            log_secure "4" "$CMD"
---------------------------------

The keyboard type name 'macintosh_old' here may be replaced
with an other local keyboard definition, so it should probably be a
defined in configuration file.

---------------------------------

PS. Dear FreeNX developers - Please publish a pseudo code,
or an overview of freenx. It was difficult for me to find the
places of interest in the code. I am sure that more people will
fix stuff, if they would know where to look.




More information about the FreeNX-kNX mailing list