/******************************************************************************************************************* *File Name : key.h *Description : key function define. base on Jean J. Labrosse's KEY.H file. *Date : 2008/06/13 *Author : yuanguiyou --History: ------------------------------------------------------------------------------------------------------------------ *change info: *******************************************************************************************************************/ #ifndef KEY_H #define KEY_H #define KEY_RPT_DLY 2 /* Number of scan times before auto repeat executes again */ #define KEY_RPT_START_DLY 10 /* Number of scan times before auto repeat function engages*/ #define KEY_SCAN_TASK_DLY 20 /* Number of milliseconds between keyboard scans */ #define KEY_SCAN_TASK_PRIO 10 /* Set priority of keyboard scan task */ #define KEY_SCAN_TASK_STK_SIZE 64 /* Size of keyboard scan task stack */ #define KEY_SHIFT1_MSK 0x00 /* The SHIFT1 key is on bit B7 of the column input port */ /* (A 0x00 indicates that a SHIFT1 key is not present) */ #define KEY_SHIFT1_OFFSET 24 /* The scan code offset to add when SHIFT1 is pressed */ #define KEY_SHIFT2_MSK 0x00 /* The SHIFT2 key is on bit B6 of the column input port */ /* (A 0x00 indicates that an SHIFT2 key is not present) */ #define KEY_SHIFT2_OFFSET 48 /* The scan code offset to add when SHIFT2 is pressed */ #define KEY_SHIFT3_MSK 0x00 /* The SHIFT3 key is on bit B5 of the column input port */ /* (A 0x00 indicates that a SHIFT3 key is not present) */ #define KEY_SHIFT3_OFFSET 0 /* The scan code offset to add when SHIFT3 is pressed */ /* ********************************************************************************************************* * FUNCTION PROTOTYPES ********************************************************************************************************* */ void KeyFlush(void); /* Flush the keyboard buffer */ INT8U KeyGetKey(INT16U to); /* Get a key scan code from driver if one is present, -1 else */ INT32U KeyGetKeyDownTime(void); /* Get how long key has been pressed (in milliseconds) */ BOOLEAN KeyHit(void); /* See if a key has been pressed (TRUE if so, FALSE if not) */ void KeyInit(void); /* Initialize the keyboard handler */ #endif