Caps/CTRL switching not working

Forum / NoMachine for Windows / Caps/CTRL switching not working

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • #11089

    I have switched to NX 5 at work.

    The system I’m connecting to is a RHEL VM running KDE 3.5.

    I followed the instructions to make a new keyboard map (from stackoverflow last year)

    Run setxkbmap -print | xkbcomp -xkb -o original.xkb -.

    Then copy original.xkb to switch-LALT-LCTL.xkb. Keep the file original.xkb as a backup, better remove write permission.

    Edit switch-LALT-LCTL.xkb in the block xkb_keycodes and exchange the keycodes for LALTand LCTL.

    Run xkbcomp switch-LALT-LCTL.xkb $DISPLAY to active your new layout. Run xkbcomp original.xkb $DISPLAY to restore the old one.This worked wonderfully. I upgraded and now the behavior is changed. When I run the script to swap Left CTRL and CAPS, it switches–but the caps lock still turns on and off…

    Example at the command prompt. Type asdf, then +a to go to the beginning of the line, then type asdf again. I will get ASDFasdf. The caps lock key and the control now seem to be mapped to the same key.

    Running xev, I see that after running the script to swap the keys–pressing CAPS shows up as Control_L, and pressing LCTRL shows up as Caps_Lock.

    It seems like the new version of NX is doing something with Caps now. Is there a way to disable this? Or is there a way I can swap Caps and CTRL on KDE?


    The problems you get with version 5 arise because server and client try to keep in sync the state of CAPS.

    I’d suggest not to use xkbcomp scripting anymore but use ctrl:swapcaps option in the keyboard layout description. Depending on the client OS:



    Run a terminal in the client OS and set ctrl:swapcaps:

    setxkbmap -option ctrl:swapcaps

    Then run NoMachine client.


    Windows/OS X

    Locate file “keyboard” in the NoMachine client installation (usually C:\Program Files (x86)\NoMachine\share\keyboards in Windows or /Applications/ in OS X).

    Find line describing your keyboard layout in the file.

    Add ctrl:swapcaps in the last field, for example if your keybard is US English, change line

    English (United States),0x0409,US,en_US,,


    English (United States),0x0409,US,en_US,,ctrl:swapcaps`




    graywolf thank you for your response, this indeed does seem to be what I want.

    Since I’m on a Windows host, I went in and modified the keyboards file with the 2nd line you posted:

    English (United States),0x0409,US,en_US,,ctrl:swapcaps`

    But it still doesn’t seem to work.

    The steps I took:

    Changed my setxkbmap back
    Then I shut down the NX session
    I modified the keyboards file to include the line above
    Reconnected to my linux client

    I tried with and without the backtick at the end of the line and they both didn’t work. Should I be restarting my client?


    Sorry, the backtick was a typo.

    Check the client log to be sure option ctrl:swapcaps is passed correctly (search for a file named “session” in %USERPROFILE%\.nx\R-…).

    You need also swapcaps in the remote session. Check with sexkbmap -print. If swapcaps is not set, add it with setxkbmap -option ctrl:swapcaps

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

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