Esempio n. 1
0
        /// <summary>
        /// check if the [#Shift] was existed with [Shift]
        /// </summary>
        /// <param name="strKeyCodes"></param>
        /// <returns></returns>
        private ERR_VALIDATION CheckWinUp(string strKeyCodes)
        {
            string s = strKeyCodes;

            if (this.AllowSingleFunctionKey)
            {
                if (s == KB9Const.WIN_DOWN || s == KB9Const.RWIN_DOWN)
                {
                    return(ERR_VALIDATION.OK);
                }
                if (s == KB9Const.Win_DownUp() ||
                    s == KB9Const.RWin_DownUp())
                {
                    return(ERR_VALIDATION.Single_Function_With_Up);
                }
                //s = adjust_allow_last_extend_function_key(s, KB9Const.WIN_DOWN);
                //s = adjust_allow_last_extend_function_key(s, KB9Const.RWIN_DOWN);
            }
            //if there is [Win], or [RWin], string must have corresponded [#Shift] or [#RShift]
            ERR_KEYPAIR err = CheckKeyPair(s, KB9KeyDefinition.KeyDisplayName(Keys.LWin), KB9KeyDefinition.KeyUpDisplayName(Keys.LWin));

            if (err == ERR_KEYPAIR.Less_Down)
            {
                return(ERR_VALIDATION.Less_WinDown);
            }
            if (err == ERR_KEYPAIR.Less_Up)
            {
                return(ERR_VALIDATION.Less_WinUp);
            }
            if (err == ERR_KEYPAIR.Up_Before_Down)
            {
                return(ERR_VALIDATION.DownUp_Messed);
            }

            err = CheckKeyPair(s, KB9KeyDefinition.KeyDisplayName(Keys.RWin), KB9KeyDefinition.KeyUpDisplayName(Keys.RWin));
            if (err == ERR_KEYPAIR.Less_Down)
            {
                return(ERR_VALIDATION.Less_RWinDown);
            }
            if (err == ERR_KEYPAIR.Less_Up)
            {
                return(ERR_VALIDATION.Less_RWinUp);
            }
            if (err == ERR_KEYPAIR.Up_Before_Down)
            {
                return(ERR_VALIDATION.DownUp_Messed);
            }

            return(ERR_VALIDATION.OK);
        }