/*****************************************************************************
 *
 *      Name:     xkeytran.h
 *
 *      $Id$
 *
 *      Purpose:  PACKET_ALT_KEYBOARD2 packet types and special characters.
 *
 *      Copyright 1998-2010 Citrix Systems, Inc. All Rights Reserved.
 *
 *****************************************************************************/

#ifndef __XKEYTRAN_H__
#define __XKEYTRAN_H__

#ifdef UNICODESUPPORT

/*
*****************************************************************
mapping file scan code override table
*****************************************************************
*/
#define MAX_SCAN_CODES_PER_KEY  10

typedef struct _XtoScanTab
{
        IU32    keycode;
        IU32    numScansMake;
        UCHAR   scansMake[MAX_SCAN_CODES_PER_KEY];
        IU32    numScansBreak;
        UCHAR   scansBreak[MAX_SCAN_CODES_PER_KEY];
}XTOSCANTAB, *PXTOSCANTAB;

extern  IU32          G_numScanCodeOverrides;
extern  PXTOSCANTAB   G_pXtoScanTab;
                                        
/*
*****************************************************************
Packet types
*****************************************************************
*/
typedef enum
{
ICAPKT_UNUSED,
ICAPKT_UNICODE,
ICAPKT_CONTROL,
ICAPKT_KEYSYM,
ICAPKT_SCANCODE,

FUNC_KS_OR_CONTROL,  
FUNC_KS_OR_SPECIAL,
FUNC_SPECIAL_DECIMAL,
FUNC_SPECIAL_META,
FUNC_SPECIAL_0,
FUNC_SPECIAL_BACKSLASH,
FUNC_SPECIAL_TILDE,
FUNC_SPECIAL_DOSH,
FUNC_SPECIAL_YEN,
FUNC_SPECIAL_OVERLINE,
FUNC_SUN_EDIT,

ICAPKT_UNKNOWN
} PacketType;

/*
*****************************************************************
Special key codes
*****************************************************************
*/
typedef enum 
{
ICAKEY_ESCAPE,      /*  0 */
ICAKEY_BACKSPACE,   /*  1 */
ICAKEY_TAB,         /*  2 */
ICAKEY_ENTER,       /*  3 */
ICAKEY_CONTROL_L,   /*  4 */
ICAKEY_SHIFT_L,     /*  5 */
ICAKEY_SHIFT_R,     /*  6 */
ICAKEY_KP_MULT,     /*  7 */
ICAKEY_ALT_L,       /*  8 */
ICAKEY_SPACE,       /*  9 */
ICAKEY_CAPS_LOCK,   /* 10 */
ICAKEY_F1,          /* 11 */
ICAKEY_F2,          /* 12 */
ICAKEY_F3,          /* 13 */
ICAKEY_F4,          /* 14 */
ICAKEY_F5,          /* 15 */
ICAKEY_F6,          /* 16 */
ICAKEY_F7,          /* 17 */
ICAKEY_F8,          /* 18 */
ICAKEY_F9,          /* 19 */
ICAKEY_F10,         /* 20 */
ICAKEY_SCROLL_LOCK, /* 21 */
ICAKEY_KP_7,        /* 22 */
ICAKEY_KP_8,        /* 23 */
ICAKEY_KP_9,        /* 24 */
ICAKEY_KP_4,        /* 25 */
ICAKEY_KP_5,        /* 26 */
ICAKEY_KP_6,        /* 27 */
ICAKEY_KP_1,        /* 28 */
ICAKEY_KP_2,        /* 29 */
ICAKEY_KP_3,        /* 30 */
ICAKEY_KP_0,        /* 31 */
ICAKEY_KP_MINUS,    /* 32 */
ICAKEY_KP_PLUS,     /* 33 */
ICAKEY_KP_DELETE,   /* 34 */
ICAKEY_F11,         /* 35 */
ICAKEY_F12,         /* 36 */
ICAKEY_NUM_LOCK,    /* 37 */
ICAKEY_F13,         /* 38 */
ICAKEY_F14,         /* 39 */
ICAKEY_F15,         /* 40 */
ICAKEY_F16,         /* 41 */
ICAKEY_F17,         /* 42 */
ICAKEY_F18,         /* 43 */
ICAKEY_F19,         /* 44 */
ICAKEY_F20,         /* 45 */
ICAKEY_F21,         /* 46 */
ICAKEY_F22,         /* 47 */
ICAKEY_F23,         /* 48 */
ICAKEY_F24,         /* 49 */
ICAKEY_KP_ENTER,    /* 50 */
ICAKEY_CONTROL_R,   /* 51 */
ICAKEY_KP_DIVIDE,   /* 52 */
ICAKEY_ALT_R,       /* 53 */
ICAKEY_INSERT,      /* 54 */
ICAKEY_HOME,        /* 55 */
ICAKEY_PAGEUP,      /* 56 */
ICAKEY_DELETE,      /* 57 */
ICAKEY_END,         /* 58 */
ICAKEY_PAGEDOWN,    /* 59 */
ICAKEY_UP,          /* 60 */
ICAKEY_LEFT,        /* 61 */
ICAKEY_DOWN,        /* 62 */
ICAKEY_RIGHT,       /* 63 */
ICAKEY_WINDOWS_L,   /* 64 */
ICAKEY_WINDOWS_R,   /* 65 */
ICAKEY_APPLICATION, /* 66 */
ICAKEY_PAUSE,       /* 67 */
ICAKEY_PRINT_SCREEN,/* 68 */
ICAKEY_KANJI,       /* 69 */
ICAKEY_MU_HENKAN,   /* 70 */
ICAKEY_ZEN_KOUHO,   /* 71 */
ICAKEY_KATAKANA_HIRAGANA, /* 72 */

/* Special keys not in ICA spec.
 * All ICA spec enumerations should be before these.
 * These enums should be handled within the client -
 * the values should never be sent to the server.
 */
INTERNAL_EISU_TOGGLE,
NO_TRAN,
}SpecialKeys;

#endif	/* UNICODESUPPORT */

#endif /* __XKEYTRAN_H__ */
