Source

mule-base / texi / kbd-trans.texi

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
\input texinfo	@c -*-texinfo-*-
@setfilename ../info/kbd-trans
@settitle Keyboard translation

@titlepage
@sp 6
@center @titlefont{Keyboard translation}
@sp 4
@center Version 2.0
@sp 5
@center Naoto TAKAHASHI
@center ntakahas@@etl.go.jp
@page

@end titlepage

@node Top, , , (mule)
@section Keyboard translation

Some quail packages, for example, Russian, Greek, Hebrew, etc.,
completely re-map the key layout.  In these cases, it is desirable to
provide the same key layout no matter what keyboard is actually used.
For this purpose, a variable *quail-keyboard-translate-table* is
introduced.  It is used to absorb the differences between the various
real keyboards and the 'ideal' standard keyboard.  Currently, 12
predefined constants are provided.  See the following carefully and
set the apropriate constant to @code{quail-keyboard-translate-table} in
your @file{.emacs} file.  For example, if you are using SUN type4 keyboard,
put
@example
(setq *quail-keyboard-translate-table*
      *quail-keyboard-translate-table-sun-type4*)
@end example

in your .emacs.

@menu
* Keyboard translate tables::
* Writing new keyboard translate table::
@end menu

@node Keyboard translate tables, Writing new keyboard translate table, , Top
@section Predefined keyboard translate tables

Here's a list of predefined keyboard translate tables.

If you don't find your keyboard in the following list, make yours by
yourself @xref{Writing new keyboard translate table}.

@itemize
@item @code{quail-keyboard-standard-table}
@example
machines: vt100, etc.

[unshifted]

Esc 1  2  3  4  5  6  7  8  9  0  -  =  `
     q  w  e  r  t  y  u  i  o  p  [  ]
      a  s  d  f  g  h  j  k  l  ;  '  \
       z  x  c  v  b  n  m  ,  .  /
                 SPACE

[shifted]

Esc !  @  #  $  %  ^  &  *  (  )  _  +  ~
     Q  W  E  R  T  Y  U  I  O  P  {  }
      A  S  D  F  G  H  J  K  L  :  "  |
       Z  X  C  V  B  N  M  <  >  ?
                 SPACE
@end example

@item @code{quail-keyboard-translate-table-sun-type3}
@example
machines: SUN type3 keyboard
	  SUN type5 keyboard
	  TAKAOKA XMiNT (AX keyboard)
	  JCC Xstation / GloabalX (AX keyboard)

[unshifted]

Esc 1  2  3  4  5  6  7  8  9  0  -  =  \  `
     q  w  e  r  t  y  u  i  o  p  [  ]
      a  s  d  f  g  h  j  k  l  ;  '
       z  x  c  v  b  n  m  ,  .  /
                 SPACE

[shifted]

Esc !  @  #  $  %  ^  &  *  (  )  _  +  |  ~
     Q  W  E  R  T  Y  U  I  O  P  {  }
      A  S  D  F  G  H  J  K  L  :  "
       Z  X  C  V  B  N  M  <  >  ?
                 SPACE
@end example

@item @code{quail-keyboard-translate-table-sun-type4}
@example
machines: SUN type4 keyboard

[unshifted]

                                  \
Esc 1  2  3  4  5  6  7  8  9  0  -  =
     q  w  e  r  t  y  u  i  o  p  [  ]
      a  s  d  f  g  h  j  k  l  ;  '  `
       z  x  c  v  b  n  m  ,  .  /
                 SPACE

[shifted]

                                  |
Esc !  @  #  $  %  ^  &  *  (  )  _  +
     Q  W  E  R  T  Y  U  I  O  P  {  }
      A  S  D  F  G  H  J  K  L  :  "  ~
       Z  X  C  V  B  N  M  <  >  ?
                 SPACE
@end example

@item @code{quail-keyboard-translate-table-sony-nwp-411a}
@example
machines: NEWS-3470

[unshifted]

Esc 1  2  3  4  5  6  7  8  9  0  -  =  \
     q  w  e  r  t  y  u  i  o  p  [  ]
      a  s  d  f  g  h  j  k  l  ;  '  `
       z  x  c  v  b  n  m  ,  .  /
                 SPACE

[shifted]

Esc !  @  #  $  %  ^  &  *  (  )  _  +  |
     Q  W  E  R  T  Y  U  I  O  P  {  }
      A  S  D  F  G  H  J  K  L  :  "  ~
       Z  X  C  V  B  N  M  <  >  ?
                 SPACE
@end example

@item @code{quail-keyboard-translate-table-ibm-at}
@example
machines: IBM AT keyboard

[unshifted]

 `  1  2  3  4  5  6  7  8  9  0  -  =  \
     q  w  e  r  t  y  u  i  o  p  [  ]
      a  s  d  f  g  h  j  k  l  ;  '
       z  x  c  v  b  n  m  ,  .  /
                 SPACE

[shifted]

 ~  !  @  #  $  %  ^  &  *  (  )  _  +  |
     Q  W  E  R  T  Y  U  I  O  P  {  }
      A  S  D  F  G  H  J  K  L  :  "
       Z  X  C  V  B  N  M  <  >  ?
                 SPACE
@end example

@item @code{quail-keyboard-translate-table-ibm-rt/pc}
@example
machines: IBM RT/PC 5085 keyboard
	  RS6000 (English keyboard)
	  Apple Macintosh MO115 keyboard / Power Book
	  SGI Iris Indigo

[unshifted]

 `  1  2  3  4  5  6  7  8  9  0  -  =
     q  w  e  r  t  y  u  i  o  p  [  ]  \
      a  s  d  f  g  h  j  k  l  ;  '
       z  x  c  v  b  n  m  ,  .  /
                 SPACE

[shifted]

 ~  !  @  #  $  %  ^  &  *  (  )  _  +
     Q  W  E  R  T  Y  U  I  O  P  {  }  |
      A  S  D  F  G  H  J  K  L  :  "
       Z  X  C  V  B  N  M  <  >  ?
                 SPACE
@end example

@item @code{quail-keyboard-translate-table-decstation}
@example
machines: DEC DECstation3100 LK201 keyboard (vt100 mode)
	  DEC DECstation3100 LK401-AJ keyboard (vt100 mode)

[unshifted]

    1  2  3  4  5  6  7  8  9  0  -  =
     q  w  e  r  t  y  u  i  o  p  [  ]
      a  s  d  f  g  h  j  k  l  ;  '  \
     `  z  x  c  v  b  n  m  ,  .  /
                 SPACE

[shifted]

    !  @  #  $  %  ^  &  *  (  )  _  +
     Q  W  E  R  T  Y  U  I  O  P  {  }
      A  S  D  F  G  H  J  K  L  :  "  |
    ~  Z  X  C  V  B  N  M  <  >  ?
                 SPACE
@end example

@item @code{quail-keyboard-translate-table-dynabook}
@example
machines: TOSHIBA Dynabook386/20 keyboard

[unshifted]

    1  2  3  4  5  6  7  8  9  0  -  =
     q  w  e  r  t  y  u  i  o  p  [  ]
      a  s  d  f  g  h  j  k  l  ;  '
       z  x  c  v  b  n  m  ,  .  /
           \     SPACE       `

[shifted]

    !  @  #  $  %  ^  &  *  (  )  _  +
     Q  W  E  R  T  Y  U  I  O  P  {  }
      A  S  D  F  G  H  J  K  L  :  "
       Z  X  C  V  B  N  M  <  >  ?
           |     SPACE       ~
@end example

@item @code{quail-keyboard-translate-table-mac-mo110}
@example
machines: Apple Macintosh MO110 keyboard

[unshifted]

 `  1  2  3  4  5  6  7  8  9  0  -  =
     q  w  e  r  t  y  u  i  o  p  [  ]
      a  s  d  f  g  h  j  k  l  ;  '
       z  x  c  v  b  n  m  ,  .  /
                 SPACE          \

[shifted]

 ~  !  @  #  $  %  ^  &  *  (  )  _  +
     Q  W  E  R  T  Y  U  I  O  P  {  }
      A  S  D  F  G  H  J  K  L  :  "
       Z  X  C  V  B  N  M  <  >  ?
                 SPACE          |
@end example

@item @code{quail-keyboard-translate-table-mac-mo116}
@example
machines: Apple Macintosh MO116 keyboard

[unshifted]

Esc 1  2  3  4  5  6  7  8  9  0  -  =
     q  w  e  r  t  y  u  i  o  p  [  ]
      a  s  d  f  g  h  j  k  l  ;  '
       z  x  c  v  b  n  m  ,  .  /
           `     SPACE       \

[shifted]

Esc !  @  #  $  %  ^  &  *  (  )  _  +
     Q  W  E  R  T  Y  U  I  O  P  {  }
      A  S  D  F  G  H  J  K  L  :  "
       Z  X  C  V  B  N  M  <  >  ?
           ~     SPACE       |
@end example

@item @code{quail-keyboard-translate-table-jis}
@example
machines: NEC PC-9801 keyboard
	  NEC EWS4800/220, /260
	  EPSON PC-286 keyboard

[unshifted]

Esc 1  2  3  4  5  6  7  8  9  0  -  ^  \
     q  w  e  r  t  y  u  i  o  p  @  [
      a  s  d  f  g  h  j  k  l  ;  :  ]
       z  x  c  v  b  n  m  ,  .  /
                 SPACE

[shifted]

Esc !  "  #  $  %  &  '  (  )  0  =  `  |
     Q  W  E  R  T  Y  U  I  O  P  ~  {
      A  S  D  F  G  H  J  K  L  +  *  }
       Z  X  C  V  B  N  M  <  >  ?  _
                 SPACE
@end example

@item @code{quail-keyboard-translate-table-fujitsu-sigma-230}
@example
machines: Fujitsu Sigma 230

[unshifted]

Esc 1  2  3  4  5  6  7  8  9  0  -  ^  \
     q  w  e  r  t  y  u  i  o  p  @  [
      a  s  d  f  g  h  j  k  l  ;  :  ]
       z  x  c  v  b  n  m  ,  .  /
                 SPACE

[shifted]

Esc !  "  #  $  %  &  '  (  )  0  =  ~  |
     Q  W  E  R  T  Y  U  I  O  P  `  {
      A  S  D  F  G  H  J  K  L  +  *  }
       Z  X  C  V  B  N  M  <  >  ?  _
                 SPACE
@end example
@end itemize

@node Writing new keyboard translate table, , Keyboard translate tables, Top
@section Writing new keyboard translate table

@code{quail-keyboard-translate-table} consists of two parts.  One is a
string and the other is an a-list.  The string part, which is the
@code{car} (or @code{nth 0}) of this variable, describes the
`normalised' layout of your keyboard.  (The meaning of 'normalised'
will soon be given.)  The a-list part, which is the 'cadr' (or 'nth 1')
of the variable describes the 'unusually' located keys and their
position.

Let's take IBM AT keyboard as an example.  It looks like this:

@example
[AT unshifted]

 `  1  2  3  4  5  6  7  8  9  0  -  =  \
     q  w  e  r  t  y  u  i  o  p  [  ]
      a  s  d  f  g  h  j  k  l  ;  '
       z  x  c  v  b  n  m  ,  .  /
                 SPACE

[AT shifted]

 ~  !  @  #  $  %  ^  &  *  (  )  _  +  |
     Q  W  E  R  T  Y  U  I  O  P  {  }
      A  S  D  F  G  H  J  K  L  :  "
       Z  X  C  V  B  N  M  <  >  ?
                 SPACE
@end example

First, normalise the layout of the keyboard.  'To normalise' means 'to
move some keys so that the number of columns and the number of rows
will match those of @code{quail-keyboard-standard-table}.

@code{quail-keyboard-standard-table} looks like this:

@example
[STANDARD unshifted]

    1  2  3  4  5  6  7  8  9  0  -  =  `
     q  w  e  r  t  y  u  i  o  p  [  ]
      a  s  d  f  g  h  j  k  l  ;  '  \
       z  x  c  v  b  n  m  ,  .  /
                 SPACE

[STANDARD shifted]

    !  @  #  $  %  ^  &  *  (  )  _  +  ~
     Q  W  E  R  T  Y  U  I  O  P  {  }
      A  S  D  F  G  H  J  K  L  :  "  |
       Z  X  C  V  B  N  M  <  >  ?
                 SPACE
@end example

Note that @code{quail-keyboard-standard-table} has no keys left to the 1!
key.  It has;
@enumerate
@item
13 keys at the top row, and
@item
12 keys at the 2nd row, and
@item
12 keys at the 3rd row, and
@item
10 keys at the 4th row, and
@item
1 space bar at the bottom.
@end enumerate

To normalise the AT keyboard, it is necessary to move the `~ key to
the right end of the 3rd row.

@example
[AT normalised unshifted]

    1  2  3  4  5  6  7  8  9  0  -  =  \
     q  w  e  r  t  y  u  i  o  p  [  ]
      a  s  d  f  g  h  j  k  l  ;  '  `
       z  x  c  v  b  n  m  ,  .  /
                 SPACE

[AT normalised shifted]

    !  @  #  $  %  ^  &  *  (  )  _  +  |
     Q  W  E  R  T  Y  U  I  O  P  {  }
      A  S  D  F  G  H  J  K  L  :  "  ~
       Z  X  C  V  B  N  M  <  >  ?
                 SPACE
@end example

Now describe this layout by a string from left to right, up to down,
unshifted to shifted.  Unshifted space should be appended at the end
of the string.  There's no shifted space.  The resulting string looks
like this:

@example
"1234567890-=\\qwertyuiop[]asdfghjkl;'`zxcvbnm,./!@@#$%^&*()_+|QWERTYUIOP@{@}ASDFGHJKL:\"~ZXCVBNM<>? "
@end example

Note that '"' (double quote) and '\' (backslash) must be escaped by a
'\'.  This string will be the 'car' of *quail-keyboard-translate-table*.

Next, specify the real location of the moved characters.  In our
example only one KEY (`~) is moved, but this causes two CHARACTERs to
be moved.

The location should be given by a vector of the form:
@quotation
@code{[ x-position  y-position  shift-or-not ]}
@end quotation

For the keys in the first row, x-position means the offset from the 1!
key.  For example, the x-position of '2' is 1, that of '3' is 2, and
that of '=' is 11.  That of '1' itself is 0.  In IBM AT keyboard, '`'
and '~' locate to the left of the 1! key, so their x-position will
be -1.

For the keys in the 2nd, the 3rd, and the bottom row, their x-position
will be the offset from 'q', 'a', and 'z', respectively.

The y-position is the offset from the top row (i.e. the row which
contains 1234...).  So the y-position of '5' is 0, 't' is 1, 'g' is 2,
and 'b' is 3.  Keys above the top row will have a negative y-position.

The third element shift-or-not is 0 if not shifted, and 1 if shifted.

So, the real location of '`' in the AT keyboard will be [-1 0 0] and
that of '~' will be [-1 0 1].  These two locations will be coded into
an a-list together with the characters they are presenting:

  '((?` [-1 0 0]) (?~ [-1 0 1]))

Now we have both the string part and the a-list part.  So the
*quail-keyboard-translate-table* for IBM AT keyboard will be as
follows.  
@example
'("1234567890-=\\qwertyuiop[]asdfghjkl;'`zxcvbnm,./!@@#$%^&*()_+|QWERTYUIOP@{@}ASDFGHJKL:\"~ZXCVBNM<>?" ((?` [-1 0 0]) (?~ [-1 0 1])))}
@end example
When you put these beasts in your .emacs, it would be better to divide
the string part according to the rows so that you can check easily.

@example
(setq *quail-keyboard-translate-table* '("\
1234567890-=\\\
qwertyuiop[]\
asdfghjkl;'`\
zxcvbnm,./\
!@@#$%^&*()_+|\
QWERTYUIOP@{@}\
ASDFGHJKL:\"~\
ZXCVBNM<>?\
 "
  ((?` [-1 0 0]) (?~ [-1 0 1]))))
}
@end example


@contents
@bye
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.