Beispiel #1
0
        public void Add(Keys KeyData, KeyEvent Action, KeyEventEx ActionEx, object Param, int State, int LeaveState)
        {
            Hashtable hashtable1 = (Hashtable)this.states[State];

            if (hashtable1 == null)
            {
                hashtable1 = new Hashtable();
                this.states.Add(State, hashtable1);
            }
            hashtable1[KeyData] = new KeyListData(KeyData, Action, ActionEx, Param, LeaveState);
        }
Beispiel #2
0
        private KeyListData GetKeyData(Keys KeyData, int State)
        {
            KeyListData data1      = null;
            Hashtable   hashtable1 = (Hashtable)this.states[State];

            if (hashtable1 != null)
            {
                data1 = (KeyListData)hashtable1[KeyData];
            }
            if (data1 == null)
            {
                hashtable1 = (Hashtable)this.states[-1];
                if (hashtable1 != null)
                {
                    data1 = (KeyListData)hashtable1[KeyData];
                }
            }
            return(data1);
        }
Beispiel #3
0
        public bool ExecuteKey(Keys KeyData, ref int State)
        {
            KeyListData data1 = this.GetKeyData(KeyData, State);

            if (data1 == null)
            {
                return(false);
            }
            if (data1.Action != null)
            {
                data1.Action();
            }
            else if (data1.ActionEx != null)
            {
                data1.ActionEx(data1.Param);
            }
            State = data1.LeaveState;
            return(true);
        }