#ifndef AEEVCODES_H
#define AEEVCODES_H
/*===================================================================
FILE: AEEVCodes.h

SERVICES:  AEE Virtual Codes and Type Definitions

DESCRIPTION:
  This header defines virtual codes and types for for Key, Screen,
  LED, etc.

PUBLIC CLASSES AND FUNCTIONS:

        Copyright © 1999-2002 QUALCOMM Incorporated.
               All Rights Reserved.
            QUALCOMM Proprietary/GTDR
===================================================================*/

//-------------------------------------------------------------------
// Defines
//-------------------------------------------------------------------
#define AEE_INVALID_CODE 0xE010

// Base offset

#define AEE_AVK_BASE 0xE020 // For Keys
#define AEE_AVS_BASE 0      // For Screens
#define AEE_AVL_BASE 0      // For LEDs

#define AVK_MAX_OVERLOAD 5

//
// EVT_KEY dwParam bits.  These bits are sent as "dwParam" values to EVT_KEY, EVT_KEY_PRESS, etc.
//

#define KB_LSHIFT      0x00000001   // Left Shift Key
#define KB_RSHIFT      0x00000002   // Right Shift Key
#define KB_LCTRL       0x00000004   // Left Control Key
#define KB_RCTRL       0x00000008   // Right Control Key
#define KB_LALT        0x00000010   // Left Alt/Menu Key
#define KB_RALT        0x00000020   // Right Alt/Menu Key
#define KB_AUTOREPEAT  0x00000040   // Auto-repeat bit (1 if auto-repeat key event)

// Auto-Repeat
//
// Keys are auto-repeated starting KB_AUTOREPEAT_START msecs after the initial EVT_KEY 
// is received.  The app will then start receiving EVT_KEY with the KB_AUTOREPEAT bit
// set every KB_AUTOREPEAT_RATE msecs.
//

#define KB_AUTOREPEAT_START   (1500)
#define KB_AUTOREPEAT_RATE    (100)


// Bits for sticky modifier keys

#define KB_CAPSLOCK    0x00010000   // Caps Lock Key
#define KB_SCROLLLK    0x00020000   // Scroll Lock Key
#define KB_NUMLOCK     0x00040000   // Num Lock Key

// Macro to check Key state of a key

#define IS_KEY_DOWN(v,k) (boolean)((v)&(k)? TRUE : FALSE)

//
// EVT_KEY, EVT_KEY_PRESS, EVT_KEY_RELEASE virtual keys
//

enum _AVKType {
   AVK_UNDEFINED = AEE_INVALID_CODE,
   AVK_FIRST = AEE_AVK_BASE,

   AVK_0,
   AVK_1,
   AVK_2,
   AVK_3,
   AVK_4,
   AVK_5,
   AVK_6,
   AVK_7,
   AVK_8,
   AVK_9,
   AVK_STAR,
   AVK_POUND,

   AVK_POWER,
   AVK_END,
   AVK_SEND,
   AVK_CLR,

   AVK_UP,
   AVK_DOWN,
   AVK_LEFT,
   AVK_RIGHT,
   AVK_SELECT,

   AVK_SOFT1,
   AVK_SOFT2,
   AVK_SOFT3,
   AVK_SOFT4,

   AVK_FUNCTION1,
   AVK_FUNCTION2,
   AVK_FUNCTION3,

   AVK_FUNCTION,
   AVK_MENU,
   AVK_INFO,

   AVK_SHIFT,

   AVK_MESSAGE,
   AVK_MUTE,

   AVK_STORE,
   AVK_RECALL,

   AVK_PUNC1,
   AVK_PUNC2,

   AVK_VOLUME_UP,
   AVK_VOLUME_DOWN,

   AVK_WEB_ACCESS,
   AVK_VOICE_MEMO,
   AVK_SPEAKER,
   AVK_TAP,    // TAP Event

   AVK_PTT,
   AVK_LSHIFT,
   AVK_RSHIFT,
   AVK_LCTRL,
   AVK_RCTRL,
   AVK_LALT,
   AVK_RALT,
   AVK_CAPLK,
   AVK_SCRLK,
   AVK_NUMLK,
   AVK_LNGHANGUL,
   AVK_LNGJUNJA,
   AVK_LNGFIN,
   AVK_LNGHANJA,
   AVK_PRSCRN,
   AVK_BREAK,
   AVK_TXINSERT,
   AVK_TXDELETE,
   AVK_TXHOME,
   AVK_TXEND,
   AVK_TXPGUP,
   AVK_TXPGDOWN,

   // Gamepad Keys
   AVK_GP_1,    // Gamepad Key 1
   AVK_GP_2,    // Gamepad Key 2
   AVK_GP_3,    // Gamepad Key 3
   AVK_GP_4,    // Gamepad Key 4
   AVK_GP_5,    // Gamepad Key 5
   AVK_GP_6,    // Gamepad Key 6
   AVK_GP_SL,   // Gamepad Key Shoulder Left
   AVK_GP_SR,   // Gamepad Key Shoulder Right

   AVK_LAST
};
#ifdef WIN32
typedef unsigned AVKType;
#else
typedef uint16 AVKType;
#endif // AEE_SIMULATOR

// AEE Virtual Screen codes
enum _AVSType {
   AVS_UNDEFINED = AEE_INVALID_CODE,

   AVS_FIRST = AEE_AVS_BASE,

   AVS_SCREEN_0,
   AVS_SCREEN_1,
   AVS_SCREEN_2,
   AVS_SCREEN_3,

   AVS_LAST
};
#ifdef WIN32
typedef unsigned AVSType;
#else
typedef uint16 AVSType;
#endif // AEE_SIMULATOR

// AEE Virtual LED codes

enum _AVLType {
   AVL_UNDEFINED = AEE_INVALID_CODE,

   AVL_FIRST = AEE_AVL_BASE,

   AVL_LED_0,
   AVL_LED_1,
   AVL_LED_2,
   AVL_LED_3,
   AVL_LED_4,
   AVL_LED_5,
   AVL_LED_6,
   AVL_LED_7,

   AVL_LAST
};
#ifdef WIN32
typedef unsigned AVLType;
#else
typedef uint16 AVLType;
#endif // AEE_SIMULATOR

#endif  /* end ifndef AEEVCODES_H */
