/*
 * akbd.h
 *
 * [Generated from akbd, 25 September 1996]
 */

#if !defined(__CC_NORCROFT) || !defined(__arm)
  #error You must use the Norcroft ARM Compiler for Sapphire programs
#endif

#pragma include_only_once
#pragma force_top_level

#ifndef __akbd_h
#define __akbd_h

#ifndef __sapphire_h
  #include "sapphire.h"
#endif

/*----- Overview ----------------------------------------------------------*
 *
 * Functions provided:
 *
 *  akbd_test
 *  akbd_translate
 *  akbd_pollKey
 */

/* --- akbd_test --- *
 *
 * On entry:	R0 == internal key number to test
 *
 * On exit:	CS if key was pressed, CC otherwise
 *
 * Use:		Informs you whether a given key is currently being pressed.
 */

extern routine akbd_test;

/* --- akbd_translate --- *
 *
 * On entry:	R0 == Wimp key number
 *
 * On exit:	R0 == Straylight extended keyset key number
 *
 * Use:		Translates a Wimp key number into one of the more specific
 *		Straylight key numbers.
 */

extern routine akbd_translate;

/* --- akbd_pollKey --- *
 *
 * On entry:	--
 *
 * On exit:	CC if a key was in the buffer and
 *		  R0 == wimp translated key code
 *		else CS and
 *		  R0 corrupted
 *
 * Use:		Reports whether the user has typed ahead, and if so what the ;		keypress. Note that the keypresses returned are WIMP-type,
 *		not Straylight extended ones so you will have to use
 *		akbd_translate if you need the extended type.
 *
 *		This call could be used to allow buffering of keypresses:
 *		on a Key_Pressed event you would call this routine until
 *		it returns FALSE and store the codes it returns in a buffer
 *		along with the code from the event.
 */

extern routine akbd_pollKey;

/*----- That's all, folks -------------------------------------------------*/

#endif
