[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Keyboard on X with missing keys



> > > > I'm missing the bar sign, the @ sign (I had to paste this one from
> > > > the address in the header), bracketleft, bracketright, EuroSign and I
> > > > don't know what else on the keyboard on X.
> > >
> > > Same here, on an iBook2 700Mhz. I ended up writing my own ~/.Xmodmap
> > > which i load when I login.
> >
> > It seems everybody does that, instead of fixing the X keymaps... I'm no
> > better myself. :)

The root of the problem is the XFree86 definition of the macintosh keymap. In 
the file /etc/X11/xkb/keymap/macintosh you can see this definition:

default xkb_keymap "macintosh" {
    xkb_keycodes        { include "xfree86"                             };
    xkb_types           { include "default"                             };
    xkb_compatibility   { include "default"                             };
    xkb_symbols         { include "macintosh/us(extended)"              };
    xkb_geometry        { include "macintosh"                           };
};

Notice that the xkb_symbols are us(extended). So anytime someone uses an 
non-us keyboard with powerpc, the keymap will be wrong. The right thing here 
is probably that xkb_symbols and xkb_geometry shouldn't be set here, but 
right in the XF86Config-4. But I'm not totally sure what the right thing is.

> My problem is that I definitely would not be able to load the previous
> keymap simply because I don't know where my current, though crippled keymap
> for X is installed, and where it was copied from to its current place, or
> whether it was copied from somewhere at all, or whether it is simply part
> of the kernel.
>
> I don't even know whether the console and X use 2 different keymaps in 2
> different places, or whether a single, common one is used.

Keyboards for Debian are configured in two places. One for the console and one 
for X. To change the console keymap, you `dpkg-reconfigure console-data` but 
it seems that you have the right keymap in the console (when you hit 
<ctrl>-<alt>-<F1>). When reconfiguring console-data, the keymap is put into 
/etc/console/boottime.kmap.gz (and the old one is in 
/etc/console/boottime.old.kmap.gz). I believe that there is also a hard-coded 
US keymap in the kernel, in case the console-data setup is broken, but it 
seems that yours is OK (except for the Euro).

Configuring a keyboard for XFree86 is a different thing. The X11 keyboard 
configuration changed recently to be more flexible, but less clear. The 
settings for the different keyboards can be found in /etc/X11/xkb. Finding 
out exactly what's going on is difficult. The old way was much simpler to 
understand, because it was a single file that one would run with xmodmap to 
change the behavior of the keyboard. Now, xmodmap is deprecated, and 
setxkbmap "should" be used, but it's so difficult to understand, that 
everyone still uses xmodmap.

This brings something else to mind. It's possible to get Xfree86 to use the 
Linux console keycodes by adding a line to the keyboard InputDevide:

        Option          "CustomKeycodes"

However, I don't know what the proper XkbRules, XkbLayout, or XkbSymbols 
should be set to when using it. I'm trying it right now, and most of the keys 
are fine, but the arrow keys and Alt_R and some other obscure modifiers are 
set incorrectly. It seems to me that if we could have a complete Linux 
keycodes XkbSymbols map, then the only configuration would have to be for 
console-data.

The other thing that's missing for me is a procedure for testing changes to 
xkb. `xmodmap .Xmodmap` is clearer to me. I know setxkbmap is the tool, but 
I'm not sure where to start.

> And this, and only this, is why I still don't see how I could find a
> working keyboard through trial and error proceedings (provided that this is
> what you were ready to accept with your suggestion in "init=/bin/sh and
> work with the default kernel keymap"). I still think this is extremely
> dangerous for login purposes *as long as I do not know how to repair it* if
> I messed up the keyboard party ...

I don't think you need to do this, because your problem is with the X 
keyboard, not the console keyboard.

> As I said before: Docs, good docs ... :)

Heh. Luck, good luck. The fact is, there aren't any good docs on this. There 
are a lot of docs, but they're really difficult to understand for someone not 
immersed in xkb. That said, this is the best doc I've seen:

http://www.charvolant.org/~doug/xkb/

Frank



Reply to: