8

When I start up Xephyr inside of X, my keyboard map becomes wonky mostly just for non-printing characters. I can't use arrow keys. According to xev, The down arrow gets mapped to Super_R. The up arrow is Print Screen. PgDown is mapped to "Menu". My keyboard works fine in the original X display (:0), but in the Xephyr subdisplay (:1), nothing else quite works right.

I don't have any funky xmodmap things going on in my main X display that I'm aware of. All I really do is setxkbmap -option ctrl:swapcaps.

quack quixote
  • 43,504
qedi
  • 1,681

7 Answers7

5

I found Bug 19365 which solved my problem:

Starting Xnest / Xephyr with -kb.

qedi
  • 1,681
2

The -kb option doesn't work in Ubuntu 10.04. Here's what worked for me:

Xephyr -keybd ephyr,,,xkbmodel=evdev -ac -screen 800x600 -br -reset -terminate :1

Jim Hunziker
  • 1,233
1

After more unsuccessful googling, man setxkbmap finally pointed me into an easier solution:

USING WITH xkbcomp

If you have an Xserver and a client shell running on different computers and XKB configuration files on those machines are different you can get problems specifying a keyboard map by model, layout, options names.[...] You can solve this problem by running the xkbcomp on the client side too.[..] For example, the command

setxkbmap us -print | xkbcomp - $DISPLAY

makes both steps run on the same (client) machine and loads a keyboard map into the server.

That is,

  • launch Xephyr:

    Xephyr -ac -reset -screen 800x600 -retro :50 &
    

    (no need to provide keyboard info)

  • and configure the new xsession:

    setxkbmap de -print | xkbcomp - :50
    

    (you need to know your keyboard layout)

Note: setxkbmap is your friend, and from version 1.2.0 the useful -query option is available to help you troubleshooting your keyboard (see the corresponding patch log).

Alberto
  • 220
1

You can also run xkbcomp $DISPLAY :1 in X session in which Xephyr was started. This command will copy keyboard map from current server to your newly created. I use it like this:

Xephyr -screen 800x600 :1 > /dev/null &
sleep 2 && xkbcomp $DISPLAY :1
DISPLAY=":1" ./runcommand
Tomasz
  • 11
1
setxkbmap -model evdev -print | xkbcomp :100 :200    

If you use Xephyr with xpra and you have incorrect keyboard map. If you see strange situation: Down key worked as enter (down arrow as break line), up arrow not working - use that command for set true xkb map.

:100 - Display number with control of xpra

:200 - Display number control of Xephyr

May be that command help, if you use x2go and mate desktop environment (if x2go settings keyboard on client turned off)

0

For me (using german keyboard), it only works the combination of the previous solution pointed by Arjan together with the solution pointed by panzi in Xephyr keyboard layout, that is:

Start Xephyr:

Xephyr -keybd ephyr,,,xkbmodel=evdev,xkblayout=de -ac -reset -screen 800x600 -retro :1 &

Save current keyboard mapping and start an xterm loading the mapping:

xmodmap -pke > /tmp/my_modmap ; xterm -display :1 -ls -e "xmodmap /tmp/my_modmap; bash" &

Xephyr server: xserver-xephyr 2:1.9.5-1

Thanks to the original posters!

Alberto
  • 220
0

It seems you're not using SSH for this, right? Still, the following might get you started; it's what I scribbled down to troubleshoot keyboard issues when using ssh -Y:

You can save the current keyboard mapping (when not running Xephyr) using:

xmodmap -pke > ~/my_xmodmap

Then, in Xephyr, you could try to explicitly load that:

xmodmap ~/my_xmodmap

And using xev you can monitor keyboard events. That probably won't help much by itself, but might help you Googling more helpful articles as that command is sometimes mentioned in such articles.

Arjan
  • 31,511