Alan Mackenzie <a...@muc.de> writes:

> Hello, Lee.
>
> On Fri, Jun 05, 2015 at 11:33:47PM +0200, lee wrote:
>> Hi,
>
>> which keymap are we supposed to use for a keyboard that has 122 keys?
>
> I think you might have to roll your own.  As a warning, this can't be
> done in a single hour.

It seems so --- I looked at the provided keymaps and found that they are
an awful mess of including many maps into another to somehow finally get
a desired result.

The problem I currently have is that the function keys F12--F24 (and
some others) send two key presses rather than their own keycodes.  So
first I need to get the keyboard itself out of the mode it's in.  And I
found that the keyboard works fine when going into the BIOS and doesn't
work at all when booting, already at the stage when grub shows it's
menu.  When that happens, I need to unplug the keyboard, and it works
when I plug it back in. When I don't enter the BIOS before booting, the
keyboard works fine.

Other than that, I switched to the US layout, and what the keys do now
basically matches their labels.

> As a matter of interest, what are all the extra keys for?  What legend is
> embossed upon them, and where are they, physically, relative to the
> "qwerty" part of the keyboard?

There's a bunch of keys on the left side of the keyboard, in two rows:


|----------+-------|
| SysRq    | ScrLk |
| Esc      |       |
| Attr     |       |
|----------+-------|
| Print    | Pause |
| Screen   | Clear |
| SysRq    | Break |
|----------+-------|
| Print    | Help  |
|----------+-------|
| Record   | Play  |
|----------+-------|
| [window] | Menu  |
|----------+-------|


There are 24 function keys, and the layout of the cursor keys is like
a plus sign because there's a Home key in the middle of the arrows.
The keys above that are kinda weird because there's a backspace and
what looks like an Enter key, with Drop/Insert/Zoom and Delete in the
middle and PgUp and PgDown on the left.  The end key is part of the
keypad.

That will take a while to get used to.

I like having extra keys so I can put something onto them, like
switching to particular windows, starting applications and
emacs-functions I frequently use.  I'm using a lot of virtual desktops,
all the windows usually fullscreen, so it's much easier and faster to
press, for example, F24 to switch to or between emacs frames than it is
to go through the window list or to find an empty desktop to look at the
pager to figure out where the window is I want to switch to.

Just use something like:


DestroyFunc WarpToEmacs
AddToFunc WarpToEmacs
        + I Next ("Emacs")              WarpToWindow 50 50


and bind that to a key.  Since F13--F24 are usually not used by
anything, they'd be perfect for things like this.  That these stupid
"Windoze"-keys don't get in the way of the Ctrl and Alt keys is a big
advantage --- I hate those, yet now I can actually make use of them
because they are located conveniently.

Other than that, Unicomp keyboards are hard to get here as you need to
import them, which involves more or less unforeseeable costs (shipping
and taxes).  Fortunately, there was a good offer on ebay, and they not
only handle the international shipping at bearable rates and customs but
even tell you exactly what it will cost.  So you pay that and get it
shipped to your door without any further ado, just like anything else
you order online.  Without that, I would have to pay as much or even
more for shipping alone as I pay for the keyboard itself.

> My comments from this point on are about the console keyboard.  I don't
> know much about X keyboards, though I do have a little utility,
> xfce4-xkb-plugin, in my XFCE which swaps from British to German layout at
> the click of a mouse.  My console keyboard is an extensively enhanced
> version of a British layout, with the seven German letters on
> <AltGr>a/o/u/s, and many extra key combinations that are needed in Emacs,
> together with combinations for <Ctrl>arrow-keys, etc.

That sounds as if you could use a keyboard that has more keys :)

With some, if not most, keyboards that feature an US layout, you simply
do not have the keys for some of the letters needed for German.  And
without having the physical keys, you can adjust your layout all you
want, it will still suck :)

So I made sure to get a keyboard that does have these keys.  Of course,
they have different labels, but I don't mind.  And I have a Model M at
hand, so I guess I could even switch out the keycaps to get the correct
labels if I wanted to.

>> And which keyboard type are we supposed to specify?  There's pc_102,
>> pc_105 and whatnot; is there such a thing as pc_122, too?
>
> I doubt it.  Probably, you'll be just fine with pc_105.  Try it!  (Where
> is this set, by the way?  I set mine to pc_105, but forgotton where I did
> it).

It's in a (snippet) of xorg.conf, see
http://www.x.org/archive/X11R7.5/doc/input/XKB-Config.html

You can also switch layouts by pressing a key combination.

>> So far, I plugged the keyboard in (it's USB) and it has a layout I can
>> expect (which is kinda amazing), so I'm typing on it now.  What I
>> want is a keyboard configuration that corresponds to the labels on the
>> keys (which is an US layout) as a starting point, and a way to switch
>> between the US layout and a layout adapted to German.  Most of what I
>> type is in English, and the US layout is much better suited for
>> programming, so for the few cases I do need the extra keys required for
>> German, I want to be able to switch layouts by pressing a key.  That
>> goes for both console and X11 --- my experience is that you first have
>> to get the keyboard set up correctly for the console before you have a
>> chance to get it to fully work with X11.
>
> I don't know of any way of switching the console keyboard as easily as
> you probably want.  To switch layouts you need loadkeys (a utility
> program very close to the kernel).  As I said, my workaround here is to
> put the German letters on <AltGr> combinations.  It surprised me just how
> seldomly ä,ö,ü,ß are actually used in German text.

They are used quite frequently ... I finally got rid of AltGr; it's a
pretty weird thing to have.  However, I have all the keys these letters
would be on with a German keyboard layout, so if I would switch, they
can all be where they are supposed to be.

> You could put the string "loadkeys /home/lee/kbd-d.map.gz<CR>" (and a
> similar one for kbd-e.map.gz) on some difficult-to-type-accidentally key
> combination, with which you'd be able to change layouts from a bash
> command line.  Just beware that the the same key layout is used by all
> the virtual terminals - there's no way of setting a key layout for just
> one VT.

Hm, I rarely use the console here, so it's not that important.  Isn't
there a way to define hotkeys on the console?

> I would recommend you to start by copying a standard keyboard layout from
> /usr/share/keymaps/... (or dumping your current one with dumpkeys), then
> enhancing it.  Read the man pages for loadkeys, dumpkeys, keymaps, etc.
> They are in package sys-apps/kbd.
>
> To find out what the keycodes are for "obscure" keys, use showkey.

Yes, if I can get the keys that now send combinations to work correctly,
I could start by putting together a keymap in a single file from what's
already there and adjust that to what I need.

If I can't get those keys to work correctly, is there a way to somehow
make it so that the keys that send multiple keycodes are considered as
the extra/additional keys they actually are?

> If you'd like a copy of my keyboard layout to help you on your way, just
> drop me a personal email.

Thanks :)

>> The keyboard shows up as: "Unicomp Inc. Surf Ruffian USB 122 Keyboard v
>> 2.50".  Xev shows that the function keys F13--F24 yield the same scan
>> codes as F1--F12.  I still have a 105 key PS/2 keyboard plugged in, and
>> nothing is prepared for the 122 key keyboard, so that might limit what
>> scan codes are being seen.
>
>
>> BTW, this keyboard is awesome.  It's just as if you had a Model M, but
>> still new, and there isn't anything better available new.  I've been
>> using those for about 20 years now and wanted a new one since quite a
>> while, now finally managed to get a Unicomp ... Get one if you can; live
>> is too short for bad keyboards.
>
> :-)  I have a Filco mechanical keyboard, which works well.  Does your new
> keyboard need more desk space than a standard one?  That would be a
> negative feature for me.

Yes, it's pretty large.  It's a bit longer than a Model M and has about
the same depth.  My desk is large enough; you might be able to fit one
if you get a monitor arm :)


-- 
Again we must be afraid of speaking of daemons for fear that daemons
might swallow us.  Finally, this fear has become reasonable.

Reply via email to