I have issues with the keymap of my NX session being garbled.
I have a Macbook Air running OS X Lion. I use OpenNX to start a session with an Ubuntu server running F
I wanted to provide a complete practical solution. I was experiencing the same problem on some Fedora FC20 machines. That's the complete how-to that should work copying and pasting.
username is your username to connect remotely using ssh to the machine you need to run x2go on and machine is the hostname of that machine.
NOTE: If you have custom keymappings on the target machine they tend to mess up with x2go. To make this work I needed to reset the keymappings and set a bare English (US). I was using International English (US) with Dead keys and it was not working...
Has been tested on Mac Book Pro Mid 2010, 2011 and 2013. New Retina machines seem to not be affected by this bug.
Create a keymap definition file using xmodmap on your local machine (the client machine), XQuartz might be necessary for having this command available. It's also necessary to use x2go by the way.
xmodmap -pke > osx-keymap
If xmodmap is not found that means it's not in the PATH, if you installed XQuartz the command should be placed in /usr/X11/bin/xmodmap so instead of using just xmodmap prepend to it the full path.
Append some modifiers to the file (as from the ato answer)
echo '! Now reset all the modifiers too
!
clear shift
clear lock
clear control
clear mod1
clear mod2
clear mod3
clear mod4
clear mod5
add shift = Shift_L Shift_R
add lock = Caps_Lock
add control = Control_L Control_R
add mod1 = Alt_L Alt_R
add mod2 = Meta_L Meta_R' >> osx-keymap
Load the file on the machine (username is your username to login on the machines. Change it!)
scp osx-keymap username@machine:~/.Xmodmap
Create a script on the Desktop that can be run just using the mouse if the keyboard does not work
ssh username@machine <<"STR"
echo '#/usr/bin/env bash
xmodmap ~/.Xmodmap;'>~/Desktop/fix_keyboard.sh; chmod +x ~/Desktop/fix_keyboard.sh
STR
Connect with x2go. Basically it should work.
If it still does not work try to:
x2gorun_keyboard.sh on the desktop with the mouse and select Run.x2go