Note that this table is not describing the character set in order to
find out how to type characters! The table here can be used e.g.
when designing a driver for the infrared receiving device. - The
character set for typing can be found here.

GKOS
Keyboard Codes

The table on the left defines the keycodes that are transmitted
from a GKOS keyboard by using a wireless infrared link or UART serial
port. Infrared codes can be sent in different IR formats. These include
IrDA
physical layer frame structure for transmitted
individual bytes, and SIRCS-type 11-bit
GKOS-specific IR frames (key code packets).

The most robust and the
recommended way for the IR link is that GKOS chord values (=
status of the keyboard) are sent. In this case, the table here is not
used by the IR sending keyboard. Just the keyboard status is sent
repeatedly using GKOS IR chord value packets.
This is
also compatible with all previous PIC projects. The IR receiver will in that
case determine the chords and send the Keycodes through the UART/COM
port
to the driver.

There are no separate codes for pressing and releasing a key for most
characters. Only 'sticky keys' (e.g. Shift, Ctrl, Alt and AltGr) have
both
key-down and key-up codes.

This table can remain as it is also for all national layouts because
national versions can preferrably be implemented at the device drivers
at the
receiving side. The symbols listed here map to the physical chords as
defind for the FIN/SWE and US versions of the GKOS keyboard layout. To
switch between US and FIN/SWE layout modes, type [Alt] [123-ABC]
('Alternative mode').

RS232
Connector (UART serial
port)

At the RS232 connector, one
byte per character is sent unless there are separate codes for key up
and key down (two bytes then).

The IrDA frame consist of one start bit ('0'), 8 data bits and one stop
bit ('1'). Bit rate 9600 bit/s is used. Each '0' is represented by an
IR pulse with a duration of 3/16 of the bit period. For logical '1's,
nothing is sent.

The receiving routine of the device driver should check first if a
Header byte is received. If the answer is yes, the next byte is
received and checked for a correct Device Address. If correct,
the character code is then received and passed to the operting system
as a corresponding keyboard entry. If there is an error in the address,
a new Header is needed next. If, instead of the address or keycode, a
Header is received, a valid Device Address shall be received next.

The GKOS IR byte transmission
of key code packets (SIRCS-type IR data but only 11-bit frames)
has 8
bits of data and 3 bits of address information, so only
one frame per character (one byte, LSB first, plus IR address bits)
needs to be sent:

Transmission order is [start pulse] D0...D7 A0 A1 A2. This
IR transmission method is not as robust to IR interference as the GKOS
chord IR packets described above.

Notes

SYMB, 123-ABC, CAPS

Information about pressing SYMB and 123-ABC keys is sent but they
should normally be ignored by the driver at the reception because they
already have
an impact on the Keycode to send.

CAPS (caps lock) status is indicated by the first bit of the Keycode
(CAPS ON/OFF) to better
synchronise the CAPS status at both ends. CAPS has no separate key down
and key up codes.

Shortcuts

A string of codes corresponding to a series of key presses can be sent
by entering certain shortcuts
on the GKOS keyboard. For example,
typing e-as a chordon
(no release of common keys between characters) causes transmission of a
series of Keycodes (at UART) to type the word each followed
by a space.

Mouse Data

Keycode 128 is special.
After it, four Keycodes will always be sent but their values must be
enterpreted as mouse data (see
bottom of this page). This method of sending mouse data is used
on the UART serial port (RS232) and can also be used on a fast secure
link like Bluetooth. (Mouse data transfer using IrDA bytes may also be
practical but if a fast real IrDA link with the protocols
involved is used, then the Keycode 128 method can well be applied.) End
of Mouse Data, Keycode 255, is
sent after the 4 bytes of mouse data to ensure integrity. If the value
of the 5th byte received (by the driver) is not 255, the mouse data is
discarded and reception of Keycodes is started. - On
the slower GKOS IR link, the shorter GKOS
mouse data packets are used as specified earlier.

All Keys Up signals (253 and 192)

UART KeyCode
Mode
Keycode 253 (AKU) is sent on
UART once every time all keys are released indicating
wheter characters were entered as a chordon (string of chords) or not.
This makes it possible for the driver to detect entering of
Chordon Shortcuts in order to send the corresponding shortcut word. For
example, if the driver receives [AKU] ? w [AKU] it will send "what ".

UART Chord
Mode
Sending KeyCodes 192, in a row 127 times, at the start up
(and each time all keys are released) indicates that all
other bytes
received on the UART are Chord values (1...63) and not final
KeyCodes. Chord values just indicate the state of the 6 keys and
they
are sent at 10 ms intervals. Chord values 1 to 63 are sent via
UART as the 6
LSBs of KeyCodes 193 to 255. Chord value 0 (all keys up) is sent
as
KeyCode 192, 128 times repeatedly unless any key is pressed.
- This method assumes that the driver software takes care of
most things, like the decisions on typed characters, shortcuts etc, and
the interface
device requirements are minimal. Any received value less than
192 will disable this mode. This will be the next feature included in
the GKOS IR receiver and the PC driver software (GKOS on QWERTY),
making it possible to make all the many new features of the driver (now
for SDF/JKL keys) available on the IR link and PIC devices as well !

SHIFT Key / Shift ON / Shift OFF

To enable Chordon Shortcuts where the Shift key is one part of the
entry (e.g. 'Shift i' typed as a chordon produces 'I ', capital i + a
space), it is necessary to indicate the actual press of the Shift key. Drivers that provide shortcuts must
keep track of the Shift status based only on reception of the 'SHIFT
Key' signal (188, see the table). In this case, Shift ON/OFF signals
have no use.

_______________________

ADDITIONAL FEATURES

- these are needed only to set up the keyboard

To
Control AV Equipment

If the GKOS keyboard is not
functioning as a remote control for AV
equipment, for example this command can be used:

[SYMB] [Ctrl] m
[ENTER]
('Control MD')

It turns the GKOS keyboard into a MiniDisc remote control and Sony
SIRCS infrared signals are transmitted. In addition, codes 1-245 are
sent at RS232 output.

While
operating as a
remote control, the standard GKOS typing mode can be visited to
enter text, numbers
and symbols by pressing:

To exit the GKOS typing mode, press [ESC] and you are back in remote
control mode.
You can also just press [123-ABC]
to enter numbers e.g. when selecting MD/CD tracks or TV program
numbers. Press# (K) to enter numbers larger than 9.A second [123-ABC] will take back to remote commands.

Configuring
the keyboard for different devices

The GKOS keyboard may include a table for each audio/video device for
converting most codes on the table (left) to corresponding IR codes and
formats. To configure the GKOS
keyboard
for a specific
device, type:

[SYMB][Ctrl] xxx
[ENTER]
('Control xxx')

where xxx is the identity for the device (e.g. m, md or dvd) to be
remote controlled. [SYMB] may not be needed while in remote control
mode and just changing the AV device (e.g. MD mode to TV mode).

The GKOS keyboard of this project will implement:

[SYMB] [Ctrl] i
[ENTER]IrDA format, Keycodes
1-255 directly, no remote control codes,
to send IrDA formatted bytes to a
PC or PDA,

[SYMB] [Ctrl] m
[ENTER]
Sony SIRCS
format for MD, to operate a
Sony MD player and enter text
for song titles. Codes have been defined by Sony.

[SYMB] [Ctrl] g
[ENTER]
GKOS byte
mode, Keycodes
1-255 directly, no remote control codes. Send SIRCS-type 11-bit
IR frames one per character. This mode can
also be used at the reception if just the UART output is
used (e.g. connected to the PC) because chord and chordon detection
works best if IR bursts (for sending) are
short as with byte mode (one IR packet per character).

Values for Z Movement (Scroll
wheel) are in the range
of -8 to +7 and use up only the
least significant four bits (Z3, Z2, Z1, Z0).
The upper four bits (Z7, Z6, Z5,
Z4) are spare and not defined yet (In PS/2, they are
just repeated sign bits Z3). When a mouse
button is pressed the corresponding bit is set (e.g.
Bit 0 = 1 in Byte 1 when the left mouse button is down). These
four bytes
are followed by Keycode 255 (End of Mouse Data) to
ensure integrity on the data link.