Keymap issues with NX from Mac OS X Lion to Ubuntu

后端 未结 7 1595
旧时难觅i
旧时难觅i 2020-12-31 10:01

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

7条回答
  •  半阙折子戏
    2020-12-31 10:31

    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.

    1. 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.

    2. 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
      
    3. Load the file on the machine (username is your username to login on the machines. Change it!)

      scp osx-keymap username@machine:~/.Xmodmap 
      
    4. 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
      
    5. Connect with x2go. Basically it should work.

    If it still does not work try to:

    • disconnect and reconnect with x2go
    • click on the run_keyboard.sh on the desktop with the mouse and select Run.
    • as before but then disconnect and reconnect with x2go
    • Unfortunately is not a complete solution. Some computers are reported to not work with it

提交回复
热议问题