Keypad key mapping changed with NX

Forum / NoMachine for Linux / Keypad key mapping changed with NX

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #39749
    DavidOfIthaca
    Participant

    Conditions:
    NX client 7.10.1
    NX enterprise server 7.10.1 (I think looking at the log files. I’m not sure how to see the version)
    Virtual display
    Local: Mac 12.6
    Remote: SL Linux (gcc version 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC)

    I have setup my ~/.Xmodmap file to map key 79 (Num Lock/Clear on my mac keyboard) to KP_F1:

    >cat .Xmodmap
    keycode 79 = KP_F1

    If I “ssh -Y” to the remote host, xev shows the correct mapping:

    KeyPress event, serial 31, synthetic NO, window 0x1200001,
    root 0xc1, subw 0x0, time 2900618971, (-780,940), root:(1780,987),
    state 0x0, keycode 79 (keysym 0xff91, KP_F1), same_screen YES,
    XLookupString gives 0 bytes:
    XmbLookupString gives 0 bytes:
    XFilterEvent returns: False

    But when I go through NX the mapping is different:

    KeyPress event, serial 37, synthetic NO, window 0x2600001,
    root 0x114, subw 0x0, time 1229328060, (-71,-222), root:(727,267),
    state 0x0, keycode 77 (keysym 0xff7f, Num_Lock), same_screen YES,
    XLookupString gives 0 bytes:
    XmbLookupString gives 0 bytes:
    XFilterEvent returns: False

    Is there any fix for this?

    #39776
    fra81
    Moderator

    Hi,

    did you create the .Xmodmap file on the Mac or on the Linux machine?

    #39778
    DavidOfIthaca
    Participant

    .Xmodmap is present on both machines.

    #39833
    fra81
    Moderator

    The .Xmodmap file is taken into consideration by the XQuartz X server on the Mac, but will be ignored on the Linux side. When you use ‘ssh -Y’, the X server the application is connected to is XQuartz on the Mac. On the contrary, when you connect via a NoMachine virtual session, the virtual X server the application connects to runs on server side. The correct way to achieve the same behaviour with a NoMachine virtual session is to run this command in a terminal inside the session:

    xmodmap -e "keycode 79 = KP_F1"

    (Note that normally the keycode for the NumLock key is 77 on Linux and not 79 as it is for XQuartz.)

    #39841
    DavidOfIthaca
    Participant

    Ok that works. Slight correction: needed was xmodmap -e “keycode 77 = KP_F1”
    Also can put lines like keycode 77 = KP_F1 in a file and invoke using
    xmodmap <file-name>

    Thanks for the help!

Viewing 5 posts - 1 through 5 (of 5 total)

This topic was marked as solved, you can't post.