Esempio n. 1
0
        /// <summary>
        /// 响应键盘释放事件
        /// </summary>
        /// <param name="e"></param>
        private void onKeyUp(CKeyboardEventArgs e)
        {
            CKeyboardHandler <CKeyboardEventArgs> temp = m_keyUp;

            if (temp != null)
            {
                temp.Invoke(e);
            }
        }
Esempio n. 2
0
        /// <summary>
        /// 键盘事件处理
        /// </summary>
        public void keyboardEventsHandler()
        {
            CKeyboardEventArgs e;
            CKeys vKeyDown = getCurKeyboardDownKey();

            if (vKeyDown != CKeys.None)
            {
                this.m_oldKey = vKeyDown;
                e             = new CKeyboardEventArgs(vKeyDown);
                this.onKeyDown(e);
            }
            else if (m_oldKey != CKeys.None && !isKeyDown(this.m_oldKey))
            {
                e = new CKeyboardEventArgs(this.m_oldKey);
                this.onKeyUp(e);
                this.m_oldKey = CKeys.None;
            }
        }