Home XBIOSXBIOS Special commandsSpecial commands VIDIX XBIOS extensionVIDIX XBIOS extension

4.21 Keyboard functions

Bioskeys Resets Bios table for key-codes.
Kbrate Gets or alters auto-repeat of the keyboard.
Keytbl Assigns new mapping table for key-codes.

See also: ASCII table   Scancode table

4.21.1 Bioskeys

Name: »Bios standard keys« - Reinitialize keyboard.
 
Opcode: 24
 
Syntax: void Bioskeys( void );
 
Description: Bioskeys is an XBIOS routine for reinitialising the key-codes. Usually this is only required if the keyboard has been reprogrammed with the Keytbl function.
 
Return value: The function does not return a result.
 
Availability: All TOS versions.
 
Group: Keyboard functions
 
See also: Binding   Keytbl   Sconfig
 

4.21.1.1 Bindings for Bioskeys

C: #include <tos.h>
 
void Bioskeys( void );
 
Assembler:
 
move.w    #24,-(sp)    ; Offset 0
trap      #14          ; Call XBIOS
addq.l    #2,sp        ; Correct stack

4.21.2 Kbrate

Name: »keyboard rate« - Set the auto-repeat rate of the keyboard.
 
Opcode: 35
 
Syntax: int16_t Kbrate( int16_t initial, int16_t repeat );
 
Description: The XBIOS routine Kbrate obtains or alters the current auto-repeat rate of the keyboard. The following apply:
 
Parameter Meaning
 
initial Delay time before the key begins repeating (in 20ms steps). A value of -1 leaves the value unchanged.
 
repeat ime between repeats in 20ms steps. Again, a value of -1 leaves the value unchanged.
 
Return value: The function returns the setting of the auto-repeat mode as a word, in the following way:
 

Bits 0..7 : Old value of repeat rate
Bits 8..15: Old value of initial delay
Availability: All TOS versions.
 
Group: Keyboard functions
 
See also: Binding
 

4.21.2.1 Bindings for Kbrate

C: #include <tos.h>
 
int16_t Kbrate( int16_t initial, int16_t repeat );
 
Assembler:
 
move.w    repeat,-(sp)  ; Offset 4
move.w    initial,-(sp) ; Offset 2
move.w    #35,-(sp)     ; Offset 0
trap      #14           ; Call XBIOS
addq.l    #6,sp         ; Correct stack

4.21.3 Keytbl

Name: »key table« - Define the mapping table for the keyboard scancodes to key-codes.
 
Opcode: 16
 
Syntax: KEYTAB *Keytbl( void *unshift, void *shift, void *capslock );
 
Description: Keytbl is an XBIOS function with whose aid a new keyboard table for the mapping of scancodes to key-codes can be constructed. The following apply:
 
Parameter Meaning
   
unshift Pointer to unshift table, or -1
shift Pointer to Shift table, or -1
capslock Pointer to Capslock table, or -1

Note: A code is converted by using the scancode of the relevant key as an index in an array forming a table (of ASCII characters). Each of the tables has space for 128 entries, although key combinations with higher scancodes exist.
 
Return value: The function returns a pointer to the KEYTAB structure.
 
Availability: All TOS versions.
 
Group: Keyboard functions
 
See also: Binding   Bioskeys   ASCII table   Scancodes
 

4.21.3.1 Bindings for Keytbl

C: #include <tos.h>
 
KEYTAB *Keytbl( void *unshift, void *shift, void *capslock );
 
Assembler:
 
pea       capslock     ; Offset 10
pea       shift        ; Offset  6
pea       unshift      ; Offset  2
move.w    #16,-(sp)    ; Offset  0
trap      #14          ; Call XBIOS
lea       $E(sp),sp    ; Correct stack

Home XBIOSXBIOS Special commandsSpecial commands VIDIX XBIOS extensionVIDIX XBIOS extension