[SOLVED] wrong key to char mapping when starting an xterm in Xnest
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
wrong key to char mapping when starting an xterm in Xnest
hello there,
some oddity that I can't get my head to fix..
probably I need to run xmodmap (?) or something.
basically I want to run remote application in my local pc, and since ssh -Y doesn't work as expected (see this post
I started an Xnest in my local pc as follows:
Xnest -geometry 1024x768 -ac :2
and then in another terminal, I started an xterm within this Xnest server as:
xterm -display :2
The problem is that if I now try to type something, the keys that I press on my keyboard do not correspond to the keys that show up on that xterm.
how can I fix that??
thank you all for your help.
Nass
EDIT: I tried xev, the keys pressed correspond to the char that appears on screen.
EDIT2: the above statement corresponds to running xev on the local display only, if i run xev on the Xnested xterm, the key code and keysym are a mess.
analytically:
xev on local display: i press 'q' on keyboard. xev returns keycode 54 (keysym 0x71,q)
xev on Xnest display: i press 'q' on keyboard. xev returns keycode 54 (keysym 0x63,c)
hm this all seems to be due to the vnc server (hope you read the other post) for some reason (or the lack of sourcing some config file)
basically, the keycodes that are generated in a local slackbox (that has keyboard, mouse and screen), are different to the keycodes that xev understands on the pc which I accept through vnc.
so while the vnc server has some internal xmodmap file to follow, (with different keycode-keysym pairs), when I start an Xnest from within that vnc'ed session, the normal xmodmap file is sourced. only now there is keycode mismatch.
this is poorly explained so i'll give an example:
xev on local machine: I press 'q' , xev returns keycode 24, keysym 0x71 ,q
(checked with 'xmodmap -pke': keycode 24 = q Q q Q, notice that also that keycode 54 = c C c C )
xev on local machine again: I press 'c' , xev returns keycode 54, keysym 0x63 ,c
(checked with 'xmodmap -pke': keycode 54 = c C c C )
xev on vnc machine: I press 'q' , xev returns keycode 54, keysym 0x71 ,q
(the 'xmodmap -pke' returns a different xmodmap here: keycode 54 = q Q, so I get the right keysym, but for a different keycode)
xev on Xnested 3rd machine, accessed through vnc machine: I press 'q' , xev returns keycode 54, keysym 0x63 ,c
(the xmodmap of the Xnest session is indeed the same as the one on the local machine, but since it gets a different keycode from the vnc , it will also output a different keysym)
bammer, so the question is why does tightvnc understands different keycodes than the codes that the local machine understands?
ok i'm contacting tightvnc to figure out why the vnc session understands different keycodes for the keys pressed (and thus uses a different xmodmap file to show the correct characters).
In the meantime, in order for me to do what I initially wanted - that is to type the correct characters in the Xnest'ed xterm, I used the command from within the xvnc session (note that I have ssh -Y to the Xnest pc and started up the Xnest on that remote pc, not on the vnc session pc)
to get the mappings that vnc uses.
Then I ssh -Y (from within the vnc session) to the remote Xnested pc, copy the xmodmap-vnc-file (with scp perhaps) and use the same command to overload Xnests xmodmap with the vnc's xmodmap
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.