Keymap issues with NX from Mac OS X Lion to Ubuntu
Asked Answered
C

8

12

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 FreeNX. The session type is Gnome.

My keymap is very off (eg. w gives =, delete gives ",", t gives w). I tried:

xmodmap -pke > nxclient.xmodmap

on the client and,

xmodmap nxclient.xmodmap

on the server and I recover many of my keys, but it is still unusable. I tried the Gnome keyboard layouts but none worked. The problem also occurs with an XFCE session.

I would appreciate any tips. x2go worked on client and server using Gnome with no issues. Unfortunately, it does not work on Mac OS X Lion currently.

Crabby answered 10/8, 2011 at 22:36 Comment(6)
Im getting the same issue. Have you made any progress?Epaulet
I've witnessed the same problem.Hardej
I have the same problem, but with x2go instead of OpenNX. I suspect the problem is XQuartz (the OS X X11 implementation). I finally got it to work by using xmodmap -pke as suggested in this post, in combination with the answer by @ato. This seems to be a workaround, and not a real solution though.Revenge
@Revenge I don't understand really what to do. I create the file using xmodmap -pke on the OSX client. Than? What I have to do?Styx
@SolidSnake You need to copy the resulting file, say keymap-x2go-osx file to the server, and call xmodmap keymap-x2go-osx when starting your window manager (WM) or desktop manager (DM). This might be done via, e.g., the .xinitrc, or via a different method when using Gnome, KDE, etc.. Basically it depends on what WM/DM you use, so you have to refer to the documentation of the WM/DE you are using.Revenge
I confirm that xmodmap -pke + @ato answer is not working for me. Sometimes rebooting x2go client works. It's not a solution btw.Styx
C
3

I found a surprisingly simple solution: disconnect the X2Go session and reconnect. This fixes the Mac keyboard issue for me (which seems to persist beyond OS X Lion).

Choose answered 17/6, 2016 at 21:15 Comment(0)
S
3

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
Styx answered 7/2, 2017 at 16:6 Comment(0)
R
2

Append this to the end of your nxclient.xmodmap generated by xmodmap -pke to get a usable layout:

!
! 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
Robeson answered 11/10, 2013 at 5:2 Comment(0)
A
2

This answer was given by @Simon in the comments of the question and works for me (x2go / Xquartz):

On OSX do:

xmodmap -pke > keymap-x2go-osx.xmodmap
echo "xmodmap ~/keymap-x2go-osx.xmodmap" > x2go-xinit

Edit keymap-x2go-osx.xmodmap and add modifier reset from @ato’s answer, then copy it to the VM:

scp keymap-x2go-osx.xmodmap -P your_port your_ip:/home/your_user/
scp x2go-xinit -P your_port your_ip:/home/your_user/.xinit
Alloy answered 17/1, 2017 at 22:5 Comment(0)
U
0

What has worked for me has been going to the system menu -> keyboard -> Layouts tab -> keyboard model -> apple -> Macintosh old. However, there are issues. I can't seem to use Control+C, Control+V, or the arrow keys. If your arrow keys do work I would be grateful if you told me what your .nxs keyboard options look like.

Unpack answered 12/12, 2011 at 17:16 Comment(1)
The solution I just posted also resolves the issues with the arrow keys. In case they do not work for you, make sure that you (temporarily) delete all keyboard shortcuts that use an arrow key.Dolph
D
0

We had the same problem, though running xfce, which is similiar to gnome2 though. I just found a solution (running Mac OSX 10.9.1):

  • Download the newest x2go client (4.0.1.3 at time of posting)
  • Setup your x2go-session to "automatically detect keyboard settings"
  • Connect and realize that e.g. tabulator is only working when you are additionally pressing the control key.
  • Solution: Edit the keyboard shortcuts in "~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml" (on the server) and delete the entry which is set up to "Super + Tab"
  • Enjoy your functional keyboard

Credits go to goofrider.

Dolph answered 27/1, 2014 at 23:1 Comment(0)
G
0

Try to change your Shell from tcsh to bash. Tcsh cause keyboard problem.

Galloglass answered 24/2, 2015 at 21:32 Comment(0)
Y
0

You can simply fix by changing one setting in Xquarts. To fix:

  1. Open Xquarts
  2. Go to preferences
  3. Check follow system keyboard layout.
  4. Done!

enter image description here

Yes answered 14/8, 2022 at 23:27 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.