EXOS 2.1 Keyboard Driver Specification

3. Special Features

3.1 Keyclick Control

When the interrupt routine detects a key press it calls a routine called KEYCLICK in the sound driver which produces an audible click. This routine is only called if the EXOS variable KEY_CLICK is zero. Thus setting this variable to a non­zero value will disable key click.

3.2 Autorepeat Control

Autorepeat is controlled by two EXOS variables. DELAY_KEY which is the delay until autorepeat starts and RATE_KEY which is the delay between each repetition of the key. Both of these are in units of 1/50 seconds. DELAY_KEY should always be longer than RATE_KEY and if DELAY_KEY is zero then autorepeat is disabled.

3.3 Function Key Programming

There are sixteen logical programmable function keys numbered 0 to 15. Keys 0 to 7 refer to the basic function keys, 8 to 15 are the shifted versions. Any one of these may be programmed with a string of characters (which may include control codes etc.) using a special function call. The defaul string for all keys is a null string.

    Parameters :  B @@FKEY (=8) (special function code)
                  C function key number (0..15)
                 DE pointer to string (length byte first)

    Returns    :  A status

The maximum legth for each programmed string is 23 characters excluding the length byte. An error (.KFSPC) will be returned if the string is too long.

If the programmed string is of zero length (null string) then this function key will cause a software interrupt when it is pressed. The software interrupt code will be ?FKEY (10h) for function key 0, up to ?FKEY+15 (1Fh) for function key 15.

3.4 Stop Key Control

There is an EXOS variable called STOP_IRQ which controls the action of the STOP key. If it is non­zero then the stop key simply returns the ASCII Ctrl­C code (03h) in the same way as all other keys. If STOP_IRQ is zero then instead of this a software interrupt is caused, with software interrupt code ?STOP (20h).

3.5 Hold Key Control

When the HOLD key is pressed the keyboard driver hangs up in its interrupt routine until the HOLD key is pressed again. This will thus freeze any listing etc. which is being produced. When it hangs up it calls a routine in the sound driver to silence the DAVE chip since any sounds will be frozen.

When the HOLD key is pressed it displays the message "HOLD" in place of the current lock mode on the status line. This message will be replaced by the correct lock mode message (which is blank for normal mode) when the hold is released. If the STOP key is pressed while in hold mode then this will force an exit from hold mode, and will then respond to the STOP key in the normal way.

While in hold mode the internal EXOS clock will still be updated so it will not loose time.

3.6 Normal Key Software Interrupts

When a normal key is pressed the character code for it is simply put in the buffer. However if the EXOS variable KEY_IRQ is non­zero then as well as returning the character code, a software interrupt will be caused with software interrupt code ?KEY (21h).

3.7 Direct Joystick Reading

A special function call is provided which will directly read the joystick on the main keyboard, or one of the two external joysticks on the control ports. The parameters for this call are:

    Parameters :  B @@JOY (=9) (special function code)
                  C      0 : internal joystick
                    1 or 2 : externnal joystick 1 or 2
                 DE pointer to string (length byte first)

    Returns    :  A status
                  C     b0 - set if right active
                        b1 - set if left active
                        b2 - set if down active
                        b3 - set if up active
                        b4 - set if fire active
                    b5..b6 - clear

Note that for the internal joystick the fire button is in fact the space bar.

Next Chapter: Quick Reference Summary.

David Bouman. (dsbouma@cs.vu.nl)