From: romano@pimac2.iet.unipi.it (Romano Giannetti)
Subject: Italian keyboard (and considerations).
Organization: Dipartimento di Informatica, Universita' di Pisa
Date: Thu, 7 Jan 1993 15:22:13 GMT

This is a post "reserved" to Italian linuxers. Following this there is
a simple patch for use italian-layout keyboard with Linux (I have
0.99pl1, I don't know if tables in keyboard.c has changed in the last
version...). 
To apply this, simply cut the following patch from this posting and
call it 'itkeyb', cd to /usr/src/linux/kernel/chr_drv 
(or wherever you keep your kernel sources) and do a 'patch < itkeyb'.
Then, to use the new keyboard layout, go into /usr/src/linux/Makefile,
comment out the current KEYBOARD and KBDFLAGS definition (near the
top) and add:
KEYBOARD = -DKBD_IT -DKBDFLAGS=0
then rebuild the kernel (make Image, then cat Image > /dev/fd0 and try
booting from the disk... before doing any other dangerous thing:).
You'll have the "strange" key so:

alt   -->  @   { [ ] }   `  ~
shift -->  "   / ( ) =   |  (degree symbol)
key  --->  2   7 8 9 0   \  (accented u)

and the "quasi-std" bindings of @#[] to the "accented vowel keys" as
well. 
NB I can see the iso-latin1 char only in vi, not in tcsh or bash; I 
think this is due to a compilation option (something like "8 bit clean 
or similar).


Now, some consideration (MHO).

#1. Do you really want the Italian keyboard? I don't. I have made this
   patch for a friend, and I do NOT use it; I am using now an italian
   layout keyboard with US driver, going blindly on "special" key. But
   why the hell the designer of italian keyboards didn't use the "dead
   key" facility to compose accented vowels? They have instead
   substituted them to some "unuseful" key, like '{' and '}' (sigh,
   no, SIGH). And so on... why '(' is on the 9 key and not on the
   8???. Perhaps i began using computers too much years ago and my
   finger go with US layout, but the missing {} in the italian
   keyboard -- or having this with strange shift-alt-ctrl-curse-key --
   is a real bogus... 
   
#2. SUGGESTION: reorganize the keyboard driver in such a way you can
   easily add keyboards layout. I am thinking to an "#include
   KEYBOARD" or similar. Better if it's possible to change the driver
   "on the fly" (It's so difficult? Keyboard tables are of fixed
   lenght... can't you overwrite them runtime?).

Now stop chatting and here is the patches. These worked for me, your
keyboard could be different...

-------------------------cut here----------------------------------
*** keyboard.c.ori	Wed Jan  6 10:08:51 1993
--- keyboard.c	Wed Jan  6 10:38:33 1993
***************
*** 356,361 ****
--- 356,409 ----
  	  0,    0,    0,    0,    0,    0,    0,    0,
  	  0 };
  
+ #elif defined KBD_IT
+ 
+ static unsigned char key_map[] = {
+ 	  0,   27,  '1',  '2',  '3',  '4',  '5',  '6',
+ 	'7',  '8',  '9',  '0',  '\'', 236,  127,    9,
+ 	'q',  'w',  'e',  'r',  't',  'y',  'u',  'i',
+ 	'o',  'p',  232,  '+',   13,    0,  'a',  's',
+ 	'd',  'f',  'g',  'h',  'j',  'k',  'l',  242,
+ 	224, '\\',   0,  249,  'z',  'x',  'c',  'v',
+ 	'b',  'n',  'm',  ',',  '.',  '-',    0,  '*',
+ 	  0,   32,    0,    0,    0,    0,    0,    0,
+ 	  0,    0,    0,    0,    0,    0,    0,    0,
+ 	  0,    0,  '-',    0,    0,    0,  '+',    0,
+ 	  0,    0,    0,    0,    0,    0,  '<',    0,
+ 	  0,    0,    0,    0,    0,    0,    0,    0,
+ 	  0 };
+ 
+ static unsigned char shift_map[] = {
+ 	  0,   27,  '!',  '"',  163,  '$',  '%',  '&',
+ 	'/',  '(',  ')',  '=',  '?',  '^',  127,    9,
+ 	'Q',  'W',  'E',  'R',  'T',  'Y',  'U',  'I',
+ 	'O',  'P',  233,  '*',   13,    0,  'A',  'S',
+ 	'D',  'F',  'G',  'H',  'J',  'K',  'L',  231,
+ 	176,  '|',  '0',  167,  'Z',  'X',  'C',  'V',
+ 	'B',  'N',  'M',  ';',  ':',  '_',    0,  '*',
+ 	  0,   32,    0,    0,    0,    0,    0,    0,
+ 	  0,    0,    0,    0,    0,    0,    0,    0,
+ 	  0,    0,  '-',    0,    0,    0,  '+',    0,
+ 	  0,    0,    0,    0,    0,    0,  '>',    0,
+ 	  0,    0,    0,    0,    0,    0,    0,    0,
+ 	  0 };
+ 
+ static unsigned char alt_map[] = {
+ 	  0,    0,    0,  '@',    0,  '$',    0,    0,
+ 	'{',   '[',  ']', '}', '\\',    0,    0,    0,
+ 	  0,    0,    0,    0,    0,    0,    0,    0,
+ 	  0,    0,  '[',  ']',   13,    0,    0,    0,
+ 	  0,    0,    0,    0,    0,    0,    0,  '@',
+ 	'#',  '`',    0,  '~',    0,    0,    0,    0,
+ 	  0,    0,    0,    0,    0,    0,    0,    0,
+ 	  0,    0,    0,    0,    0,    0,    0,    0,
+ 	  0,    0,    0,    0,    0,    0,    0,    0,
+ 	  0,    0,    0,    0,    0,    0,    0,    0,
+ 	  0,    0,    0,    0,    0,    0,  '|',    0,
+ 	  0,    0,    0,    0,    0,    0,    0,    0,
+ 	  0 };
+ 
+ 
  #elif defined KBD_US
  
  static unsigned char key_map[] = {


-- 
***************************************************************************
* Romano Giannetti          * Dip.to di Ingegneria dell'Informazione      *
*                           * Elettronica, Informatica e Telecomunicazioni*
* romano@iet.unipi.it       * via Diotisalvi,2                            *
* giannetti@sssup1.sssup.it * Universita' di Pisa, I-56126 PISA, Italy    *
***************************************************************************