From bryce Mon Sep 17 09:07:58 1990
Received: by cbmvax.cbm.commodore.com (5.57/UUCP-Project/Commodore Jan 13 1990)
	id AA01842; Mon, 17 Sep 90 09:07:51 EDT
Received: by chaos.ETHER (3.2/UUCP-Project/rel-1.0/5-18-86)
	id AA17331; Mon, 17 Sep 90 09:06:08 EDT
Date: Mon, 17 Sep 90 09:06:08 EDT
From: bryce (Bryce Nesbitt)
Message-Id: <9009171306.AA17331@chaos.ETHER>
To: darren
Subject: Official Keyboard Spec (unedited)
Status: RO




		    ------------------------------------
		    KEYBOARD INTERFACE SPECIFICATION FOR
			   A1000, A500 and A2000

		       Re-released February 22, 1989

		       BUGS!  85 microseconds!
		    ------------------------------------


The keyboard plugs into the Amiga computer via a cable with four primary
connections.  The four wires provide 5-volt power, ground, and signals called
KCLK (keyboard clock) and KDAT (keyboard data).  KCLK is unidirectional and
always driven by the keyboard; KDAT is driven by both the keyboard and the
computer.  Both signals are open-collector; there are pullup resistors in
both the keyboard (inside the keyboard microprocessor) and the computer.

Keyboard communications:

	The keyboard transmits 8-bit data words serially to the main unit.
	Before the transmission starts, both KCLK and KDAT are high.  The
	keyboard starts the transmission by putting out the first data bit
	(on KDAT), followed by a pulse on KCLK (low then high); then it puts
	out the second data bit and pulses KCLK until all eight data bits
	have been sent.  After the end of the last KCLK pulse, the keyboard
	pulls KDAT high again.

|	When the computer has received the eighth bit, it must pulse KDAT
|	low for at least 1 (one) microsecond, as a handshake signal to the
|	keyboard.  The handshake detection on the keyboard end will
|	typically use a hardware latch.  The keyboard must be able to
|	detect pulses greater than or equal to 1 microsecond.

	All codes transmitted to the computer are rotated one bit before
	transmission.  The transmitted order is therefore 6-5-4-3-2-1-0-7.
	The reason for this is to transmit the up/down flag last, in order to
	cause a key-up code to be transmitted in case the keyboard is forced
	to restore lost sync (explained in more detail below).

	The KDAT line is active low; that is, a high level (+5V) is
	interpreted as 0, and a low level (0V) is interpreted as 1.
	     _____   ___   ___	 ___   ___   ___   ___	 ___   _________
	KCLK	  \_/	\_/   \_/   \_/   \_/	\_/   \_/   \_/
	     ___________________________________________________________
	KDAT	\_____X_____X_____X_____X_____X_____X_____X_____/
		  (6)   (5)   (4)   (3)   (2)   (1)   (0)   (7)

		 First					   Last
		 sent					   sent

	The keyboard processor sets the KDAT line about 20 microseconds
	before it pulls KCLK low.  KCLK stays low for about 20 microseconds,
	then goes high again.  The processor waits another 20 microseconds
	before changing KDAT.

	Therefore, the bit rate during transmission is about 60 microseconds
	per bit, or 17 kbits/sec.

Keycodes:

	Each key has a keycode associated with it (see accompanying table).
	Keycodes are always 7 bits long.  The eighth bit is a
	"key-up"/"key-down" flag; a 0 (high level) means that the key was
	pushed down, and a 1 (low level) means the key was released (the
	CAPS LOCK key is different -- see below).

	For example, here is a diagram of the "B" key being pushed down.
	The keycode for "B" is $35 = 00110101; due to the rotation of the
	byte, the bits transmitted are 01101010.
	     _____   ___   ___	 ___   ___   ___   ___	 ___   _________
	KCLK	  \_/	\_/   \_/   \_/   \_/	\_/   \_/   \_/
	     _________		   _____       _____	   _____________
	KDAT	      \___________/	\_____/     \_____/
		   0	 1     1     0	   1	 0     1     0

	In the next example, the "B" key is released.  The keycode is still
	$35, except that bit 7 is set to indicate "key-up," resulting in a
	code of $B5 = 10110101.  After rotating, the transmission will be
	01101011:
	     _____   ___   ___	 ___   ___   ___   ___	 ___   _________
	KCLK	  \_/	\_/   \_/   \_/   \_/	\_/   \_/   \_/
	     _________		   _____       _____		 _______
	KDAT	      \___________/	\_____/     \___________/
		   0	 1     1     0	   1	 0     1     1


CAPS LOCK key:

	This key is different from all the others in that it generates a
	keycode only when it is pushed down, never when it is released.
	However, the up/down bit is still used.  When pushing the CAPS LOCK
	key turns on the CAPS LOCK LED, the up/down bit will be 0; when
	pushing CAPS LOCK shuts off the LED, the up/down bit will be 1.


"Out-of sync" condition:

	Noise or other glitches may cause the keyboard to get out of sync
	with the computer.  This means that the keyboard is finished
	transmitting a code, but the computer is somewhere in the middle of
	receiving it.

	If this happens, the keyboard will not receive its handshake pulse
	at the end of its transmission.  If the handshake pulse does not
	arrive within 143 ms of the last clock of the transmission, the
	keyboard will assume that the computer is still waiting for the
	rest of the transmission and is therefore out of sync.	The
	keyboard will then attempt to restore sync by going into "resync
	mode."  In this mode, the keyboard clocks out a 1 and waits for a
	handshake pulse. If none arrives within 143 ms, it clocks out
	another 1 and waits again.  This process will continue until a
	handshake pulse arrives.

	Once sync is restored, the keyboard will have clocked a garbage
	character into the computer.  That is why the key-up/key-down flag
	is always transmitted last.  Since the keyboard clocks out 1's to
	restore sync, the garbage character thus transmitted will appear as
	a key release, which is less dangerous than a key hit.

	Whenever the keyboard detects that it has lost sync, it will assume
	that the computer failed to receive the keycode that it had been
	trying to transmit.  Since the computer is unable to detect lost
	sync, it is the keyboard's responsibility to inform the computer of
	the disaster.  It does this by transmitting a "lost sync" code
	(value $F9 = 11111001) to the computer. Then it retransmits the
	code that had been garbled.

	Note:  the only reason to transmit the "lost sync" code to the
	computer is to alert the software that something may be screwed up.
	The "lost sync" code does not help the recovery process, because
	the garbage keycode can't be deleted, and the correct key code
	could simply be retransmitted without telling the computer that
	there was an error in the previous one.


Power-up sequence:

	There are two possible ways for the keyboard to be powered up under
	normal circumstances: <1> the computer can be turned on with the
	keyboard plugged in, or <2> the keyboard can be plugged into an
	already "on" computer.  The keyboard and computer must handle
	either case without causing any upset.

	The first thing the keyboard does on power-up is to perform a
	self-test.  This involves a ROM checksum test, simple RAM test, and
	watchdog timer test.  Whenever the keyboard is powered up (or
	restarted -- see below), it must not transmit anything until it has
	achieved synchronization with the computer. The way it does this is
	by slowly clocking out 1 bits, as described above, until it
	receives a handshake pulse.

	If the keyboard is plugged in before power-up, the keyboard may
	continue this process for several minutes as the computer struggles
	to boot up and get running.  The keyboard must continue clocking
	out 1s for however long is necessary, until it receives its
	handshake.

	If the keyboard is plugged in after power-up, no more than eight
	clocks will be needed to achieve sync.	In this case, however, the
	computer may be in any state imaginable but must not be adversely
	affected by the garbage character it will receive.  Again, because
	it receives a key release, the damage should be minimal.  The
	keyboard driver must anticipate this happening and handle it, as
	should any application that uses raw keycodes.

	Note:  the keyboard must not transmit a "lost sync" code after
	re-synchronizing due to a power-up or restart; only after
	re-synchronizing due to a handshake time-out.

	Once the keyboard and computer are in sync, the keyboard must
	inform the computer of the results of the self-test.  If the
	self-test failed for any reason, a "selftest failed" code (value
	$FC = 11111100) is transmitted (the keyboard does not wait for a
	handshake pulse after sending the "selftest failed" code).  After
	this, the keyboard processor goes into a loop in which it blinks
	the CAPS LOCK LED to inform the user of the failure.  The blinks
	are coded as bursts of one, two, three, or four blinks,
	approximately one burst per second:

			One blink    = ROM checksum failure
			Two blinks   = RAM test failed
			Three blinks = Watchdog timer test failed
			Four blinks  = A short exists between two row lines
				       or one of the seven special keys
				       (not implemented).

	If the self-test succeeds, then the keyboard will proceed to
	transmit any keys that are currently down.  First, it sends an
	"initiate power-up key stream" code (value $FD = 11111101),
	followed by the key codes of all depressed keys (with keyup/down
	set to "down" for each key).  After all keys are sent (usually
	there won't be any at all), a "terminate key stream" code (value
	$FE = 11111110) is sent.  Finally, the CAPS LOCK LED is shut off.
	This marks the end of the start-up sequence, and normal processing
	commences.

	The usual sequence of events will therefore be:  power-up;
	synchronize; transmit "initiate power-up key stream" ($FD);
	transmit "terminate key stream" ($FE).


|Reset Warning
|
|	The keyboard has the additional task of resetting the computer on
|	the command of the user.  The user initiates Reset Warning by
|	simultaneously pressing the CTRL key and the two "AMIGA" keys.
|
|	The keyboard responds to this input by syncing up any pending
|	transmit operations.  The keyboard then sends a "reset warning"
|	to the Amiga.  This action alerts the Amiga software to finish up
|	any pending operations (such as disk DMA) and prepare for reset.
|
|	A specific sequence of operations ensure that the Amiga is in a
|	state where it can respond to the reset warning.  The keyboard
|	sends two actual "reset warning" keycodes.  The Amiga must handshake
|	to the first code like any normal keystroke, else the keyboard goes
|	directly to Hard Reset.  On the second "reset warning" code the
|	Amiga must drive KDAT low within 250 milliseconds, else the keyboard
|	goes directly to Hard Reset.  If the all the tests are passed,
|	the Amiga has 10 full seconds to do emergency processing.  When the
|	Amiga pulls KDAT high again, the keyboard finally asserts hard
|	reset.
|
|	If the Amiga fails to pull KDAT high within 10 seconds, Hard Reset
|	is asserted anyway.

Hard Reset (after Reset Warning)

	The keyboard Hard Resets the Amiga by pulling KCLK low and starting
	a 500 millisecond timer.   When one or more of the keys is released
	AND 500 milliseconds have passed, the keyboard will release KCLK.
	500 milliseconds is the minimum time KCLK must be held low.  The
	maximum KCLK time depends on how long the user holds the three keys
	down.

	Note:  Circuitry on the Amiga motherboard detects the 500
	millisecond KCLK pulse.

	After releasing KCLK, the keyboard jumps to its start-up code
	(internal RESET).  This will initialize the keyboard in the same
|	way as cold power-on.  Note that the keyboard must resend the
|	"powerup key stream"!

Special Codes

	The special codes that the keyboard uses to communicate with the
	main unit are summarized here.	Note:  The special codes are 8-bit
	numbers; there is no up/down flag associated with them. However,
	the transmission bit order is the same as previously described.


	Code	   Name 	   Meaning
	--------------------------------------------------------------
|	78	Reset warning.	CTRL-AMIGA-AMIGA has been hit -
|		computer will be reset in 10 seconds. (see text)
	F9	Last key code bad, next code is the same code
		   retransmitted (used when keyboard and main unit
		   get out of sync).
	FA	Keyboard output buffer overflow
	FB	Unused (was controller failure)
	FC	Keyboard selftest failed
	FD	Initiate power-up key stream (keys pressed at powerup)
	FE	Terminate power-up key stream
	FF	Unused (was interrupt)

		    KEYBOARD HARDWARE
		    -----------------

This is a description of Commodore-Amiga's 6500/1 microprocessor
implementation.  This code is pre-approved for use with the Amiga computer
when the mask ROM keyboard microprocessor part is purchased from MOS
technology.  There are three versions of this code:

----------------------------------------------------------------------------
|328191-01    | 6570-033   | Original A1000 keyboards	 (OBSOLETE)
|	      | R1012-11   |
----------------------------------------------------------------------------
|328191-02    | 6570-036   | Keyboards with or without N-key rollover diodes
----------------------------------------------------------------------------
|328191-03    | 6570-040   | Keyboards with N-key rollover diodes
----------------------------------------------------------------------------

The -03 part provides true N-key rollover when used in a keyboard with
diodes.  The -02 part will work in a diode keyboard, but does not provide
the N-key capability.

Use of keyboards that do not include the MOS microprocessor are
discouraged, and will be handled on a case-by-case basis only.	 All
features of the Commodore-Amiga code must be implemented.


PROCESSOR

The processor is a Rockwell/NCR/MOS Technologies 6500/1.  It contains 2K
bytes of ROM, 64 bytes of RAM, and 4 I/O ports of 8 bits each.	It also has
a 16-bit timer and edge detect capability on two of the I/O lines (port A
bits 0 and 1).	It has a built-in crystal oscillator, running at 3.00
megahertz, which is divided internally to a 1.5 MHz internal clock.


RESET CIRCUITRY

There is a circuit for resetting the processor on power-on.  The reset
pulse lasts about 1 second after power is applied.  The circuit also
performs a "watchdog" function:  once the processor starts scanning the key
matrix, the watchdog timer is armed and will reset the processor if the
scanning stops for more than about 50 milliseconds.  The column 15 line is
the trigger for the watchdog timer.  Keyboards are often subject to
huge static discharges.  The keyboard must be able to reset and recover
from a microprocessor crash.


KEY MATRIX

The keys are arranged in a matrix of 6 rows and 15 columns (leaving several
holes in the matrix).  Each row is an input and has a pullup resistor to VCC
on it (R=3.3K to 11K).  Each column is an open-collector output with no
pullup, i.e., it can drive a column line low, but not high.  The program
will drive columns one at a time and read rows.

The other seven keys are special shift keys as follows:  CTRL, left SHIFT,
right SHIFT, left ALT, right ALT, left AMIGA, right AMIGA.  Each of these
keys has a dedicated input on the microprocessor.  The actual port and bit
numbers of all the keys are described below.


PORTS

As mentioned, there are four I/O ports of 8 bits each.	The following
table describes each port and the meaning of each bit:

PORT A -- 6500/1 address 080 hex
PA.0	In/Out	KDAT output/positive edge detect input (*)
PA.1	Out	KCLK output (*)
PA.2	In	Row 0 input (low = switch closed).
PA.3	In	Row 1 input
PA.4	In	Row 2 input
PA.5	In	Row 3 input
PA.6	In	Row 4 input
PA.7	In	Row 5 input

(*) These two bits are swapped from the previous code, to take
    advantage of the positive edge-detect capability of the
    PA.0 pin (it is easier to detect and latch handshake this way).

PORT B -- 6500/1 address 081 hex
PB.0	In	Right SHIFT key input (low = switch closed).
PB.1	In	Right ALT key input
PB.2	In	Right AMIGA key input
PB.3	In	CTRL key input
PB.4	In	Left SHIFT key input
PB.5	In	Left ALT key input
PB.6	In	Left AMIGA key input
PB.7	Out	CAPS LOCK LED control (high = LED on).

PORT C -- 6500/1 address 082 hex
PC.0	Out	Column 0 output (active low)
PC.1	Out	Column 1 output
PC.2	Out	Column 2 output
PC.3	Out	Column 3 output
PC.4	Out	Column 4 output
PC.5	Out	Column 5 output
PC.6	Out	Column 6 output
PC.7	Out	Column 7 output

PORT D -- 6500/1 address 083 hex
PD.0	Out	Column 8 output
PD.1	Out	Column 9 output
PD.2	Out	Column 10 output
PD.3	Out	Column 11 output
PD.4	Out	Column 12 output
PD.5	Out	Column 13 output
PD.6	Out	Column 14 output
PD.7	Out	Column 15 output (*)

(*) This keyboard has only 15 columns, numbered 0 to 14.  However,
    the microprocessor software supports 16 columns, so we can use
    it in a future keyboard.


COUNTER PIN (input or output)

On the watchdog timer board, the counter pin is connected to the
column 15 output.  On the older non-watchdog version, the counter pin
is unconnected.  This provides the keyboard processor the ability to
determine which type of board it it is installed in, so the new
processor can work in old boards (with minor changes to the board).


NMI INPUT

This is connected to VCC and will therefore never turn on.

MATRIX TABLE

The following table shows which keys are readable in port A for each
column you drive.  The key code for each key is also included (in hex).


	   Row 5   Row 4   Row 3   Row 2   Row 1   Row 0
Column	  (Bit 7) (Bit 6) (Bit 5) (Bit 4) (Bit 3) (Bit 2)
	+-------+-------+-------+-------+-------+-------+
  15	|(spare)|(spare)|(spare)|(spare)|(spare)|(spare)|
(PD.7)  |       |       |       |       |       |       |
	| (0E)  | (1C)  | (2C)  | (47)  | (48)  | (49)  |
	+-------+-------+-------+-------+-------+-------+
  14	|   *	|<SHIFT>| CAPS	|  TAB	|   ~	|  ESC	|
(PD.6)  |note 1 |note 2 | LOCK  |       |   `   |       |
	| (5D)  | (30)  | (62)  | (42)  | (00)  | (45)  |
	+-------+-------+-------+-------+-------+-------+
  13	|   +	|   Z	|   A	|   Q	|   !	|   (   |
(PD.5)  |note 1 |       |       |       |   1   |note 1 |
	| (5E)  | (31)  | (20)  | (10)  | (01)  | (5A)  |
	+-------+-------+-------+-------+-------+-------+
  12	|  9	|   X	|   S	|   W	|   @	|  F1	|
(PD.4)  |note 3 |       |       |       |   2   |       |
	| (3F)  | (32)  | (21)  | (11)  | (02)  | (50)  |
	+-------+-------+-------+-------+-------+-------+
  11	|  6	|   C	|   D	|   E	|   #	|  F2	|
(PD.3)  |note 3 |       |       |       |   3   |       |
	| (2F)  | (33)  | (22)  | (12)  | (03)  | (51)  |
	+-------+-------+-------+-------+-------+-------+
  10	|  3	|   V	|   F	|   R	|   $	|  F3	|
(PD.2)  |note 3 |       |       |       |   4   |       |
	| (1F)  | (34)  | (23)  | (13)  | (04)  | (52)  |
	+-------+-------+-------+-------+-------+-------+
   9	|  .	|   B	|   G	|   T	|   %	|  F4	|
(PD.1)  |note 3 |       |       |       |   5   |       |
	| (3C)  | (35)  | (24)  | (14)  | (05)  | (53)  |
	+-------+-------+-------+-------+-------+-------+
   8	|  8	|   N	|   H	|   Y	|   ^	|  F5	|
(PD.0)  |note 3 |       |       |       |   6   |       |
	| (3E)  | (36)  | (25)  | (15)  | (06)  | (54)  |
	+-------+-------+-------+-------+-------+-------+
   7	|  5	|   M	|   J	|   U	|   &	|   )	|
(PC.7)  |note 3 |       |       |       |   7   |note 1 |
	| (2E)  | (37)  | (26)  | (16)  | (07)  | (5B)  |
	+-------+-------+-------+-------+-------+-------+
   6	|  2	|   <	|   K	|   I	|   *	|  F6	|
(PC.6)  |note 3 |   ,   |       |       |   8   |       |
	| (1E)  | (38)  | (27)  | (17)  | (08)  | (55)  |
	+-------+-------+-------+-------+-------+-------+
   5	| ENTER |   >	|   L	|   O	|   (   |   /   |
(PC.5)  |note 3 |   .   |       |       |   9   |note 1 |
	| (43)  | (39)  | (28)  | (18)  | (09)  | (5C)  |
	+-------+-------+-------+-------+-------+-------+

	   Row 5   Row 4   Row 3   Row 2   Row 1   Row 0
Column	  (Bit 7) (Bit 6) (Bit 5) (Bit 4) (Bit 3) (Bit 2)
	+-------+-------+-------+-------+-------+-------+
   4	|  7	|   ?	|   :	|   P	|   )	|  F7	|
(PC.4)  |note 3 |   /   |   ;   |       |   0   |       |
	| (3D)  | (3A)  | (29)  | (19)  | (0A)  | (56)  |
	+-------+-------+-------+-------+-------+-------+
   3	|  4	|(spare)|   "   |   {   |   _   |  F8   |
(PC.3)  |note 3 |       |   '   |   [   |   -   |       |
	| (2D)  | (3B)  | (2A)  | (1A)  | (0B)  | (57)  |
	+-------+-------+-------+-------+-------+-------+
   2	|  1	| SPACE | <RET> |   }	|   +	|  F9	|
(PC.2)  |note 3 |  BAR  |note 2 |   ]   |   =   |       |
	| (1D)  | (40)  | (2B)  | (1B)  | (0C)  | (58)  |
	+-------+-------+-------+-------+-------+-------+
   1	|  0	| BACK	|  DEL	|RETURN |   |	|  F10	|
(PC.1)  |note 3 | SPACE |       |       |   \   |       |
	| (0F)  | (41)  | (46)  | (44)  | (0D)  | (59)  |
	+-------+-------+-------+-------+-------+-------+
   0	|  -	| CURS	| CURS	| CURS	| CURS	| HELP	|
(PC.0)  |note 3 | DOWN  | RIGHT | LEFT  |  UP   |       |
	| (4A)  | (4D)  | (4E)  | (4F)  | (4C)  | (5F)  |
	+-------+-------+-------+-------+-------+-------+

note 1: A500 and A2000 keyboards only (numeric pad )
note 2: International keyboards only (these keys are cutouts of the
	larger key on the US ASCII version.)  The key that generates
	$30 is cut out of the left shift key.  Key $2B is cut out of
	return.  These keys are labeled with country-specific markings.
note 3: Numeric pad.



The following table shows which keys are readable in port B (shift keys).
These keys never generate ghosts or phantoms even on a non N-key rollover
keyboard.

    (Bit 6) (Bit 5) (Bit 4) (Bit 3) (Bit 2) (Bit 1) (Bit 0)
   +-------+-------+-------+-------+-------+-------+-------+
   | LEFT  | LEFT  | LEFT  | CTRL  | RIGHT | RIGHT | RIGHT |
   | AMIGA | ALT   | SHIFT |	   | AMIGA |  ALT  | SHIFT |
   | (66)  | (64)  | (60)  | (63)  | (67)  | (65)  | (61)  |
   +-------+-------+-------+-------+-------+-------+-------+

From bryce Mon Sep 17 09:08:48 1990
Received: by cbmvax.cbm.commodore.com (5.57/UUCP-Project/Commodore Jan 13 1990)
	id AA01902; Mon, 17 Sep 90 09:08:47 EDT
Date: Mon, 17 Sep 90 09:08:47 EDT
From: bryce (Bryce Nesbitt)
Message-Id: <9009171308.AA01902@cbmvax.cbm.commodore.com>
To: darren
Subject: Key
Status: RO


>From porter Sun Sep  9 19:44:17 1990
Received: by cbmvax.cbm.commodore.com (5.57/UUCP-Project/Commodore Jan 13 1990)
	id AA10398; Sun, 9 Sep 90 19:44:15 EDT
Date: Sun, 9 Sep 90 19:44:15 EDT
From: porter (Jeff Porter)
Message-Id: <9009092344.AA10398@cbmvax.cbm.commodore.com>
To: andy, bryce, carl, kodiak
Subject: Re:  Out of Key Codes
Cc: gail, owens
Status: RO

The 101 key Amiga Keyboard has the following new keys:

	F11
	Insert
	Home 
	End 
	Page Up
	Page Down
	Scroll Lock
	Num Lock

Also, the HELP key is now also known as F12.

As you will note, the change consists of adding the key above the
cursor keys that a standard 101 key PC keyboard has, along with
adding F11 and F12.  

As far as I know, the following key codes are free:

0E, 1C, 2C, 47, 48, 49, 3B, 4B, 62, 68, 69, 6A, 6B, 6C, 6D, 6E, 6F.

That's 17 codes free all told.  If we need 4 for CDTV and 8 for 101
keyboards, that still leaves 5 free after all is said and done.

Does everyone agree?  Have I missed anything?  Comments?

Jeff


From bryce Mon Sep 17 09:09:02 1990
Received: by cbmvax.cbm.commodore.com (5.57/UUCP-Project/Commodore Jan 13 1990)
	id AA01924; Mon, 17 Sep 90 09:08:59 EDT
Date: Mon, 17 Sep 90 09:08:59 EDT
From: bryce (Bryce Nesbitt)
Message-Id: <9009171308.AA01924@cbmvax.cbm.commodore.com>
To: darren
Subject: Key
Status: RO


>From amiga!ks3!kodiak Sun Sep  9 20:40:49 1990
Received: by cbmvax.cbm.commodore.com (5.57/UUCP-Project/Commodore Jan 13 1990)
	id AA11602; Sun, 9 Sep 90 20:40:47 EDT
Received: from ks3.amiga.com by amiga.com (3.2/SMI-3.2)
	id AA13674; Sun, 9 Sep 90 17:29:01 PDT
Received: by ks3.amiga.com (3.2/SMI-3.2)
	id AA13048; Sun, 9 Sep 90 17:28:58 PDT
Date: Sun, 9 Sep 90 17:28:58 PDT
From: amiga!ks3!kodiak (Robert R. Burns)
Message-Id: <9009100028.AA13048@ks3.amiga.com>
To: cbmvax!andy, cbmvax!bryce, cbmvax!carl, cbmvax!porter
Subject: Re:  Out of Key Codes
Cc: cbmvax!dong, cbmvax!gail, cbmvax!owens, ks3!kodiak
Status: RO

>From cbmvax!porter Sun Sep  9 16:47:28 1990

> The 101 key Amiga Keyboard has the following new keys:
>
>	F11, Insert, Home , End , Page Up, Page Down, Scroll Lock, Num Lock
>

Do Scroll Lock & Num Lock work like Caps Lock?  I.e., do they have LEDs
associated with them on the keyboard and only report a down code when
first pressed and an up code when pressed again, with the LED staying
lit while in the "down" state?

> Also, the HELP key is now also known as F12.
> 
> As you will note, the change consists of adding the key above the
> cursor keys that a standard 101 key PC keyboard has, along with
> adding F11 and F12.  

I didn't understand this: I need a picture I guess -- but I don't think
I need to understand it to work on the keycodes :-)

> As far as I know, the following key codes are free:
>
> 0E, 1C, 2C, 47, 48, 49, 3B, 4B, 62, 68, 69, 6A, 6B, 6C, 6D, 6E, 6F.
>
> That's 17 codes free all told.  If we need 4 for CDTV and 8 for 101
> keyboards, that still leaves 5 free after all is said and done.

I've just sent porter my last email -- he wasn't on the list I replied to.

> Does everyone agree?  Have I missed anything?  Comments?

No.  Yes.  Yes...

1.  The keycodes 00-3F (hex) are historically for "typing" keys -- you
    get a character, not a special action, from them.  The keymaps are
    split in half to reflect this.  I don't know if anyone is actually
    *using* this feature, though, and five years is enough time to have
    tried if it hasn't been used yet.  [this affects 0E 1C 2C 3B from
    the above list]

2.  I agree, 47 48 49 4B are free.

3.  62 is Caps Lock.  Please don't reassign it.

4.  68 69 6A are the three mouse buttons.  Again, I don't know if anyone
    is actually taking advantage of the fact that the keycodes from the
    gameport device can be merged with the keyboard device and still be
    distinguished.

5.  68-6F, and 70-77 suffer from the lack of keyboard.device support I
    mentioned in my last mail.  If you can wait till 2.1 for the 101-key
    keyboards, I would recommend using some of these codes.  If you cannot,
    there are only 8 codes for you to use for your 8 keys, and I toss out
    the following (but I don't have to like it :-)...
	0E	Num Lock	; :-( :-( near numeric pad zero
	1C	Home		; the closest thing to a related pair left
	2C	End		; "   "       "     "  " "       "    "
	3B	Scroll Lock	; :-( :-( near numeric pad '.'
	47	Insert		; next to Delete
	48	Page Up		; as a pair near the Cursor stuff
	49	Page Down	; "  " "    "    "   "      "
	4B	F11		; :-( :-( nowhere near 5A, the logical position

6.  Gee: PageUp/PageDown sounds like SkipRev/SkipFwd to me, ditto for
    Home/End FastFwd/FastRev :-)

- Bob

P.S.  I'm only concerned about the labels on these 101-key keyboards if
    they become standard Amiga keyboards -- then folks will expect them
    to do something in the standard Amiga environment.  If so, I think
    the current keymap strategy can have only one more "qualifier"
    style key shoehorned into it -- I suspect that means "Num Lock",
    since "Scroll Lock" has always been mysterious even in PC-land.


From bryce Mon Sep 17 09:09:21 1990
Received: by cbmvax.cbm.commodore.com (5.57/UUCP-Project/Commodore Jan 13 1990)
	id AA01961; Mon, 17 Sep 90 09:09:17 EDT
Date: Mon, 17 Sep 90 09:09:17 EDT
From: bryce (Bryce Nesbitt)
Message-Id: <9009171309.AA01961@cbmvax.cbm.commodore.com>
To: darren
Subject: Key
Status: RO


>From porter Sun Sep  9 22:20:15 1990
Received: by cbmvax.cbm.commodore.com (5.57/UUCP-Project/Commodore Jan 13 1990)
	id AA14297; Sun, 9 Sep 90 22:20:11 EDT
Date: Sun, 9 Sep 90 22:20:11 EDT
From: porter (Jeff Porter)
Message-Id: <9009100220.AA14297@cbmvax.cbm.commodore.com>
To: amiga!ks3!kodiak, andy, bryce, carl
Subject: Re:  Out of Key Codes
Cc: dong, gail, owens
Status: RO


>>From cbmvax!porter Sun Sep  9 16:47:28 1990
>>
>> The 101 key Amiga Keyboard has the following new keys:
>>
>>	F11, Insert, Home , End , Page Up, Page Down, Scroll Lock, Num Lock
>
>Do Scroll Lock & Num Lock work like Caps Lock?  I.e., do they have LEDs
>associated with them on the keyboard and only report a down code when
>first pressed and an up code when pressed again, with the LED staying
>lit while in the "down" state?

	Yes, the Scroll Lock and Num Lock keys have LEDs associated
	with them.  Take a look at the PC40-III keyboard.  It has 3 LEDs
	in the upper right corner for CAPS LOCK, NUM LOCK, SCROLL LOCK.
	The three keys just to the left of these LEDs and just to
	the right of the function keys will be CAPS/NUM/SCROLL LOCK.
	This is a fairly non-traditional place for CAPS LOCK, but
	it's the best I can do to coerce things together.  This means
	that the CTRL is adjacent to the A key (where it belongs IMHO).
	The ALT and AMIGA keys are relatively in the same position.

>
>> Also, the HELP key is now also known as F12.
>> 
>> As you will note, the change consists of adding the key above the
>> cursor keys that a standard 101 key PC keyboard has, along with
>> adding F11 and F12.  
>
>I didn't understand this: I need a picture I guess -- but I don't think
>I need to understand it to work on the keycodes :-)

	Where we have DEL and HELP there will be SIX keys to comply
	with the IBM standard.  INSERT, DELETE, HOME, END, PageUp, 
	PageDown.  That's it.  The numeric pad is the same as it is
	today.  (which means we actually have 102 keys - since we
	have one more than IBM on the numeric pad)  There are 12
	function keys along the top.  IBM has no HELP key per se, 
	so I've chosen F12 to coinside with HELP. (saves a code)
>
>> As far as I know, the following key codes are free:
>>
>> 0E, 1C, 2C, 47, 48, 49, 3B, 4B, 62, 68, 69, 6A, 6B, 6C, 6D, 6E, 6F.
>>
>> That's 17 codes free all told.  If we need 4 for CDTV and 8 for 101
>> keyboards, that still leaves 5 free after all is said and done.
>
>I've just sent porter my last email -- he wasn't on the list I replied to.
>
>> Does everyone agree?  Have I missed anything?  Comments?
>
>No.  Yes.  Yes...
>
>1.  The keycodes 00-3F (hex) are historically for "typing" keys -- you
>    get a character, not a special action, from them.  The keymaps are
>    split in half to reflect this.  I don't know if anyone is actually
>    *using* this feature, though, and five years is enough time to have
>    tried if it hasn't been used yet.  [this affects 0E 1C 2C 3B from
>    the above list]
>
>2.  I agree, 47 48 49 4B are free.
>
>3.  62 is Caps Lock.  Please don't reassign it.
	
	Sorry.  Thanks.

>4.  68 69 6A are the three mouse buttons.  Again, I don't know if anyone
>    is actually taking advantage of the fact that the keycodes from the
>    gameport device can be merged with the keyboard device and still be
>    distinguished.

	Neat.  I didn't know this.  Learn something everyday.
	Is 68 = Right Mouse, 69 = Center Mouse, 6A = Left Mouse ?
>
>5.  68-6F, and 70-77 suffer from the lack of keyboard.device support I
>    mentioned in my last mail.  If you can wait till 2.1 for the 101-key
>    keyboards, I would recommend using some of these codes.  If you cannot,
>    there are only 8 codes for you to use for your 8 keys, and I toss out
>    the following (but I don't have to like it :-)...
>	0E	Num Lock	; :-( :-( near numeric pad zero
>	1C	Home		; the closest thing to a related pair left
>	2C	End		; "   "       "     "  " "       "    "
>	3B	Scroll Lock	; :-( :-( near numeric pad '.'
>	47	Insert		; next to Delete
>	48	Page Up		; as a pair near the Cursor stuff
>	49	Page Down	; "  " "    "    "   "      "
>	4B	F11		; :-( :-( nowhere near 5A, the logical position

	Officially, we are not supporting 101 key keyboards until 2.1,
	however, the US sales company has made some committments for
	Government sales in November, and may have to comply or loose
	a big contract. (eek) (I'll stall as best I can)

	These codes sound ok to me.
>
>6.  Gee: PageUp/PageDown sounds like SkipRev/SkipFwd to me, ditto for
>    Home/End FastFwd/FastRev :-)
>
>- Bob
	I certainly would have no problem having double duty for
	some of these funny IBM keys.  I guess that means that
	INSERT would be Play.  Ok by me.  Your other suggestion
	for Amiga-F1/F5 would be ok as well.  After all, you have
	a single chip micro doing all this work for you.  Multikey
	combinations are possible.

>
>P.S.  I'm only concerned about the labels on these 101-key keyboards if
>    they become standard Amiga keyboards -- then folks will expect them
>    to do something in the standard Amiga environment.  If so, I think
>    the current keymap strategy can have only one more "qualifier"
>    style key shoehorned into it -- I suspect that means "Num Lock",
>    since "Scroll Lock" has always been mysterious even in PC-land.
>
	No telling if these will become standard issue or not.
	I'm not pushing it, but the US company moves in mysterious
	ways.

	Thanks for the feedback,
	Jeff


