Gentoo Archives: gentoo-user

From: lee <lee@××××××××.de>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] which keymap and keyboard setup
Date: Sun, 07 Jun 2015 12:38:03
Message-Id: 87a8wbwv74.fsf@heimdali.yagibdah.de
In Reply to: Re: [gentoo-user] which keymap and keyboard setup by Alan Mackenzie
1 Alan Mackenzie <acm@×××.de> writes:
2
3 > Hello, Lee.
4 >
5 > On Fri, Jun 05, 2015 at 11:33:47PM +0200, lee wrote:
6 >> Hi,
7 >
8 >> which keymap are we supposed to use for a keyboard that has 122 keys?
9 >
10 > I think you might have to roll your own. As a warning, this can't be
11 > done in a single hour.
12
13 It seems so --- I looked at the provided keymaps and found that they are
14 an awful mess of including many maps into another to somehow finally get
15 a desired result.
16
17 The problem I currently have is that the function keys F12--F24 (and
18 some others) send two key presses rather than their own keycodes. So
19 first I need to get the keyboard itself out of the mode it's in. And I
20 found that the keyboard works fine when going into the BIOS and doesn't
21 work at all when booting, already at the stage when grub shows it's
22 menu. When that happens, I need to unplug the keyboard, and it works
23 when I plug it back in. When I don't enter the BIOS before booting, the
24 keyboard works fine.
25
26 Other than that, I switched to the US layout, and what the keys do now
27 basically matches their labels.
28
29 > As a matter of interest, what are all the extra keys for? What legend is
30 > embossed upon them, and where are they, physically, relative to the
31 > "qwerty" part of the keyboard?
32
33 There's a bunch of keys on the left side of the keyboard, in two rows:
34
35
36 |----------+-------|
37 | SysRq | ScrLk |
38 | Esc | |
39 | Attr | |
40 |----------+-------|
41 | Print | Pause |
42 | Screen | Clear |
43 | SysRq | Break |
44 |----------+-------|
45 | Print | Help |
46 |----------+-------|
47 | Record | Play |
48 |----------+-------|
49 | [window] | Menu |
50 |----------+-------|
51
52
53 There are 24 function keys, and the layout of the cursor keys is like
54 a plus sign because there's a Home key in the middle of the arrows.
55 The keys above that are kinda weird because there's a backspace and
56 what looks like an Enter key, with Drop/Insert/Zoom and Delete in the
57 middle and PgUp and PgDown on the left. The end key is part of the
58 keypad.
59
60 That will take a while to get used to.
61
62 I like having extra keys so I can put something onto them, like
63 switching to particular windows, starting applications and
64 emacs-functions I frequently use. I'm using a lot of virtual desktops,
65 all the windows usually fullscreen, so it's much easier and faster to
66 press, for example, F24 to switch to or between emacs frames than it is
67 to go through the window list or to find an empty desktop to look at the
68 pager to figure out where the window is I want to switch to.
69
70 Just use something like:
71
72
73 DestroyFunc WarpToEmacs
74 AddToFunc WarpToEmacs
75 + I Next ("Emacs") WarpToWindow 50 50
76
77
78 and bind that to a key. Since F13--F24 are usually not used by
79 anything, they'd be perfect for things like this. That these stupid
80 "Windoze"-keys don't get in the way of the Ctrl and Alt keys is a big
81 advantage --- I hate those, yet now I can actually make use of them
82 because they are located conveniently.
83
84 Other than that, Unicomp keyboards are hard to get here as you need to
85 import them, which involves more or less unforeseeable costs (shipping
86 and taxes). Fortunately, there was a good offer on ebay, and they not
87 only handle the international shipping at bearable rates and customs but
88 even tell you exactly what it will cost. So you pay that and get it
89 shipped to your door without any further ado, just like anything else
90 you order online. Without that, I would have to pay as much or even
91 more for shipping alone as I pay for the keyboard itself.
92
93 > My comments from this point on are about the console keyboard. I don't
94 > know much about X keyboards, though I do have a little utility,
95 > xfce4-xkb-plugin, in my XFCE which swaps from British to German layout at
96 > the click of a mouse. My console keyboard is an extensively enhanced
97 > version of a British layout, with the seven German letters on
98 > <AltGr>a/o/u/s, and many extra key combinations that are needed in Emacs,
99 > together with combinations for <Ctrl>arrow-keys, etc.
100
101 That sounds as if you could use a keyboard that has more keys :)
102
103 With some, if not most, keyboards that feature an US layout, you simply
104 do not have the keys for some of the letters needed for German. And
105 without having the physical keys, you can adjust your layout all you
106 want, it will still suck :)
107
108 So I made sure to get a keyboard that does have these keys. Of course,
109 they have different labels, but I don't mind. And I have a Model M at
110 hand, so I guess I could even switch out the keycaps to get the correct
111 labels if I wanted to.
112
113 >> And which keyboard type are we supposed to specify? There's pc_102,
114 >> pc_105 and whatnot; is there such a thing as pc_122, too?
115 >
116 > I doubt it. Probably, you'll be just fine with pc_105. Try it! (Where
117 > is this set, by the way? I set mine to pc_105, but forgotton where I did
118 > it).
119
120 It's in a (snippet) of xorg.conf, see
121 http://www.x.org/archive/X11R7.5/doc/input/XKB-Config.html
122
123 You can also switch layouts by pressing a key combination.
124
125 >> So far, I plugged the keyboard in (it's USB) and it has a layout I can
126 >> expect (which is kinda amazing), so I'm typing on it now. What I
127 >> want is a keyboard configuration that corresponds to the labels on the
128 >> keys (which is an US layout) as a starting point, and a way to switch
129 >> between the US layout and a layout adapted to German. Most of what I
130 >> type is in English, and the US layout is much better suited for
131 >> programming, so for the few cases I do need the extra keys required for
132 >> German, I want to be able to switch layouts by pressing a key. That
133 >> goes for both console and X11 --- my experience is that you first have
134 >> to get the keyboard set up correctly for the console before you have a
135 >> chance to get it to fully work with X11.
136 >
137 > I don't know of any way of switching the console keyboard as easily as
138 > you probably want. To switch layouts you need loadkeys (a utility
139 > program very close to the kernel). As I said, my workaround here is to
140 > put the German letters on <AltGr> combinations. It surprised me just how
141 > seldomly ä,ö,ü,ß are actually used in German text.
142
143 They are used quite frequently ... I finally got rid of AltGr; it's a
144 pretty weird thing to have. However, I have all the keys these letters
145 would be on with a German keyboard layout, so if I would switch, they
146 can all be where they are supposed to be.
147
148 > You could put the string "loadkeys /home/lee/kbd-d.map.gz<CR>" (and a
149 > similar one for kbd-e.map.gz) on some difficult-to-type-accidentally key
150 > combination, with which you'd be able to change layouts from a bash
151 > command line. Just beware that the the same key layout is used by all
152 > the virtual terminals - there's no way of setting a key layout for just
153 > one VT.
154
155 Hm, I rarely use the console here, so it's not that important. Isn't
156 there a way to define hotkeys on the console?
157
158 > I would recommend you to start by copying a standard keyboard layout from
159 > /usr/share/keymaps/... (or dumping your current one with dumpkeys), then
160 > enhancing it. Read the man pages for loadkeys, dumpkeys, keymaps, etc.
161 > They are in package sys-apps/kbd.
162 >
163 > To find out what the keycodes are for "obscure" keys, use showkey.
164
165 Yes, if I can get the keys that now send combinations to work correctly,
166 I could start by putting together a keymap in a single file from what's
167 already there and adjust that to what I need.
168
169 If I can't get those keys to work correctly, is there a way to somehow
170 make it so that the keys that send multiple keycodes are considered as
171 the extra/additional keys they actually are?
172
173 > If you'd like a copy of my keyboard layout to help you on your way, just
174 > drop me a personal email.
175
176 Thanks :)
177
178 >> The keyboard shows up as: "Unicomp Inc. Surf Ruffian USB 122 Keyboard v
179 >> 2.50". Xev shows that the function keys F13--F24 yield the same scan
180 >> codes as F1--F12. I still have a 105 key PS/2 keyboard plugged in, and
181 >> nothing is prepared for the 122 key keyboard, so that might limit what
182 >> scan codes are being seen.
183 >
184 >
185 >> BTW, this keyboard is awesome. It's just as if you had a Model M, but
186 >> still new, and there isn't anything better available new. I've been
187 >> using those for about 20 years now and wanted a new one since quite a
188 >> while, now finally managed to get a Unicomp ... Get one if you can; live
189 >> is too short for bad keyboards.
190 >
191 > :-) I have a Filco mechanical keyboard, which works well. Does your new
192 > keyboard need more desk space than a standard one? That would be a
193 > negative feature for me.
194
195 Yes, it's pretty large. It's a bit longer than a Model M and has about
196 the same depth. My desk is large enough; you might be able to fit one
197 if you get a monitor arm :)
198
199
200 --
201 Again we must be afraid of speaking of daemons for fear that daemons
202 might swallow us. Finally, this fear has become reasonable.