2010年12月22日 星期三

VT switching with Ctrl-Alt-Fn not working

VT switching with Ctrl-Alt-Fn not working


On upgrading the X installation on the only one of my boxes to actually have a keyboard attached to it - first from a woody backport of 4.3.0 to the sarge 4.3.0, then on to xorg 6.8.2 from sid (see here for details) - I was horrified to find that I could no longer switch from X to a text console by hitting Ctrl-Alt-Fn. I like my text consoles, so a solution was urgently required.

The solution turned out to be remarkably simple. My responses to the configuration questions posed by debconf during installation had resulted in the entry
    Option    "XkbLayout"    "uk"
in /etc/X11/xorg.conf. This appeared to work in the sense that there were no keyboard mapping errors reported in /var/log/Xorg.0.log and the punctuation characters including the pound sign all worked and were on the right keys. However, the VT switching didn't work... There were also no files named "uk" under /etc/X11/xkb/symbols/ which I found a little puzzling.

The solution was to change the entry in /etc/X11/xorg.conf to
    Option    "XkbLayout"    "gb"
The gb files under /etc/X11/xkb/symbols/ in my installation are here:
/etc/X11/xkb/symbols/gb
/etc/X11/xkb/symbols/pc/gb
/etc/X11/xkb/symbols/pc/pc
I am using a 102-key UK-layout keyboard. It may be significant that the other people who had been having this problem according to Google mostly seemed to have non-US keyboard layouts. Since I discovered the solution by fiddling about rather than by understanding how X keyboard mapping actually works, I'm not sure quite why it did work, but it may be useful for people with this problem to compare the files their X installation is using with the versions I'm using and see if there are any significant differences.

If anyone knows of any hook in X that may be used to execute an arbitrary file when switching to a text console, please contact me. At present I have to reset the framebuffer manually after switching to a text console otherwise the display screws up. A hook to enable me to do this automatically would be great, but AFAICT there's no way to do it without hacking the X source, and I can't be arsed to do that yet.

沒有留言:

張貼留言

Plurk