示例#1
0
        private void FormEKey_Load(object sender, EventArgs e)
        {
            this.Icon           = Fixer4Main.FormIcon();
            this.labelPath.Text = new string(this.m_Ekey.cmdPath);
            this.setViewText8Locale();
            this.BringToFront();
            this.comboBoxStr.Items.Clear();
            this.comboBoxStr.MeasureItem += new MeasureItemEventHandler(this.comboBoxStr_MeasureItem);
            for (int index = 0; index < KBTable.KeyBoards.Count; ++index)
            {
                KBTable keyBoard = KBTable.KeyBoards[index];
                this.comboBoxStr.Items.Add((object)keyBoard);
                if ((int)this.m_Ekey.kbtn.kbKeys[0] == (int)keyBoard.keyCode)
                {
                    this.comboBoxStr.Text = keyBoard.ToString();
                }
            }

            this.updateHNConfigToView();
        }
示例#2
0
 private string onKeyChangedListener(HuionKeyEventArgs keyEvent)
 {
     return(KBTable.getKBTable8Keys(keyEvent.KeyCode).KeyName);
 }
示例#3
0
        private void updateHNConfigToView()
        {
            if (((int)this.m_Ekey.funcBit & 4) == 4)
            {
                this.checkAlt.Checked      = this.m_Ekey.kbtn.bAlt > (byte)0;
                this.checkWindows.Checked  = this.m_Ekey.kbtn.bWin > (byte)0;
                this.CheckCtrl.Checked     = this.m_Ekey.kbtn.bCtrl > (byte)0;
                this.checkShift.Checked    = this.m_Ekey.kbtn.bShift > (byte)0;
                this.checkBoxFunKb.Checked = this.CheckCtrl.Checked || this.checkAlt.Checked ||
                                             (this.checkWindows.Checked || this.checkShift.Checked) ||
                                             Convert.ToBoolean(this.m_Ekey.kbtn.kbKeys[0]);
                for (int index = 0; index < 16 && Convert.ToBoolean(this.m_Ekey.kbtn.kbKeys[index]); ++index)
                {
                    this.huionTextView1.addKeyEvent(new HuionKeyEventArgs(
                                                        KBTable.getkeys8TableCode(this.m_Ekey.kbtn.kbKeys[index]), false, false, false, false));
                }
            }

            if (Convert.ToBoolean(this.m_Ekey.funcBit & 16U))
            {
                this.checkBoxFunMouse.Checked = true;
                this.radioMouseLeft.Checked   = true;
            }

            if (Convert.ToBoolean(this.m_Ekey.funcBit & 32U))
            {
                this.checkBoxFunMouse.Checked = true;
                this.radioMouseMid.Checked    = true;
            }

            if (Convert.ToBoolean(this.m_Ekey.funcBit & 64U))
            {
                this.checkBoxFunMouse.Checked = true;
                this.radioMouseRight.Checked  = true;
            }

            if (Convert.ToBoolean(this.m_Ekey.funcBit & 128U))
            {
                this.checkBoxFunMouse.Checked       = true;
                this.radioMouseWheelForward.Checked = true;
            }

            if (Convert.ToBoolean(this.m_Ekey.funcBit & 256U))
            {
                this.checkBoxFunMouse.Checked        = true;
                this.radioMouseWheelBackWard.Checked = true;
            }

            if (Convert.ToBoolean(this.m_Ekey.funcBit & 2U))
            {
                this.checkBoxFunSwitch.Checked = true;
                this.radioSwithBrush.Checked   = true;
            }

            if (Convert.ToBoolean(this.m_Ekey.funcBit & 1U))
            {
                this.checkBoxFunSwitch.Checked = true;
                this.radioSwitchScreen.Checked = true;
            }

            if (!Convert.ToBoolean(this.m_Ekey.funcBit & 8U))
            {
                return;
            }
            this.checkBoxFunRun.Checked = true;
        }
示例#4
0
        private void buttonOk_Click(object sender, EventArgs e)
        {
            HNStruct.HNEkey hnEkey = new HNStruct.HNEkey();
            hnEkey.cmdPath     = new char[260];
            hnEkey.kbtn.kbKeys = new byte[16];
            if (this.checkBoxFunKb.Checked)
            {
                hnEkey.kbtn.bCtrl  = this.CheckCtrl.Checked ? (byte)1 : (byte)0;
                hnEkey.kbtn.bAlt   = this.checkAlt.Checked ? (byte)1 : (byte)0;
                hnEkey.kbtn.bShift = this.checkShift.Checked ? (byte)1 : (byte)0;
                hnEkey.kbtn.bWin   = this.checkWindows.Checked ? (byte)1 : (byte)0;
                List <HuionKeyEventArgs> keyEvents = this.huionTextView1.KeyEvents;
                for (int index = 0; index < keyEvents.Count; ++index)
                {
                    hnEkey.kbtn.kbKeys[index] = KBTable.getKBTable8Keys(keyEvents[index].KeyCode).keyCode;
                }
                if (hnEkey.kbtn.bCtrl == (byte)1 || hnEkey.kbtn.bAlt == (byte)1 ||
                    (hnEkey.kbtn.bShift == (byte)1 || hnEkey.kbtn.bWin == (byte)1) || hnEkey.kbtn.kbKeys.Length != 0)
                {
                    hnEkey.funcBit |= 4U;
                }
            }

            if (this.checkBoxFunMouse.Checked)
            {
                if (this.radioMouseLeft.Checked)
                {
                    hnEkey.funcBit |= 16U;
                }
                else if (this.radioMouseRight.Checked)
                {
                    hnEkey.funcBit |= 64U;
                }
                else if (this.radioMouseMid.Checked)
                {
                    hnEkey.funcBit |= 32U;
                }
                else if (this.radioMouseWheelForward.Checked)
                {
                    hnEkey.funcBit |= 128U;
                }
                else if (this.radioMouseWheelBackWard.Checked)
                {
                    hnEkey.funcBit |= 256U;
                }
            }

            if (this.checkBoxFunSwitch.Checked)
            {
                if (this.radioSwitchScreen.Checked)
                {
                    hnEkey.funcBit |= 1U;
                }
                else if (this.radioSwithBrush.Checked)
                {
                    hnEkey.funcBit |= 2U;
                }
            }

            if (this.checkBoxFunRun.Checked && !string.IsNullOrEmpty(this.labelPath.Text.Trim()))
            {
                hnEkey.funcBit |= 8U;
                this.labelPath.Text.ToCharArray().CopyTo((Array)hnEkey.cmdPath, 0);
            }

            // ISSUE: reference to a compiler-generated field
            this.callback(this.mHolder, hnEkey);
            this.Close();
        }
示例#5
0
        private void updateHNConfigToView()
        {
            if (((int)this.m_Ekey.funcBit & 4) == 4)
            {
                this.checkAlt.Checked      = this.m_Ekey.kbtn.bAlt > (byte)0;
                this.checkWindows.Checked  = this.m_Ekey.kbtn.bWin > (byte)0;
                this.CheckCtrl.Checked     = this.m_Ekey.kbtn.bCtrl > (byte)0;
                this.checkShift.Checked    = this.m_Ekey.kbtn.bShift > (byte)0;
                this.checkBoxFunKb.Checked = this.CheckCtrl.Checked || this.checkAlt.Checked ||
                                             (this.checkWindows.Checked || this.checkShift.Checked) ||
                                             (this.radioChar.Checked || this.radioStr.Checked);
                if (Convert.ToBoolean(Convert.ToInt32(this.m_Ekey.kbtn.kbKeys[1])))
                {
                    this.checkBoxFunKb.Checked = true;
                    this.radioStr.Checked      = true;
                    for (int index = 0; index < 16 && Convert.ToBoolean(this.m_Ekey.kbtn.kbKeys[index]); ++index)
                    {
                        Label labelStr = this.labelStr;
                        labelStr.Text = labelStr.Text + (object)KBTable.getKey8Code(this.m_Ekey.kbtn.kbKeys[index]) +
                                        " ";
                    }
                }
                else
                {
                    this.radioChar.Checked     = true;
                    this.checkBoxFunKb.Checked = true;
                    this.comboBoxStr.Text     += (string)(object)KBTable.getKey8Code(this.m_Ekey.kbtn.kbKeys[0]);
                }
            }

            if (Convert.ToBoolean(this.m_Ekey.funcBit & 16U))
            {
                this.checkBoxFunMouse.Checked = true;
                this.radioMouseLeft.Checked   = true;
            }

            if (Convert.ToBoolean(this.m_Ekey.funcBit & 32U))
            {
                this.checkBoxFunMouse.Checked = true;
                this.radioMouseMid.Checked    = true;
            }

            if (Convert.ToBoolean(this.m_Ekey.funcBit & 64U))
            {
                this.checkBoxFunMouse.Checked = true;
                this.radioMouseRight.Checked  = true;
            }

            if (Convert.ToBoolean(this.m_Ekey.funcBit & 128U))
            {
                this.checkBoxFunMouse.Checked       = true;
                this.radioMouseWheelForward.Checked = true;
            }

            if (Convert.ToBoolean(this.m_Ekey.funcBit & 256U))
            {
                this.checkBoxFunMouse.Checked        = true;
                this.radioMouseWheelBackWard.Checked = true;
            }

            if (Convert.ToBoolean(this.m_Ekey.funcBit & 2U))
            {
                this.checkBoxFunSwitch.Checked = true;
                this.radioSwithBrush.Checked   = true;
            }

            if (Convert.ToBoolean(this.m_Ekey.funcBit & 1U))
            {
                this.checkBoxFunSwitch.Checked = true;
                this.radioSwitchScreen.Checked = true;
            }

            if (!Convert.ToBoolean(this.m_Ekey.funcBit & 8U))
            {
                return;
            }
            this.checkBoxFunRun.Checked = true;
        }
示例#6
0
        private void buttonOk_Click(object sender, EventArgs e)
        {
            HNStruct.HNEkey hnEkey = new HNStruct.HNEkey();
            hnEkey.cmdPath     = new char[260];
            hnEkey.kbtn.kbKeys = new byte[16];
            if (this.checkBoxFunKb.Checked)
            {
                if (this.CheckCtrl.Checked)
                {
                    hnEkey.kbtn.bCtrl = (byte)1;
                }
                if (this.checkAlt.Checked)
                {
                    hnEkey.kbtn.bAlt = (byte)1;
                }
                if (this.checkShift.Checked)
                {
                    hnEkey.kbtn.bShift = (byte)1;
                }
                if (this.checkWindows.Checked)
                {
                    hnEkey.kbtn.bWin = (byte)1;
                }
                if (this.radioChar.Checked && this.comboBoxStr.SelectedIndex != -1)
                {
                    KBTable selectedItem = (KBTable)this.comboBoxStr.SelectedItem;
                    hnEkey.kbtn.kbKeys[0] = selectedItem.keyCode;
                }
                else if (this.radioStr.Checked && !string.IsNullOrEmpty(this.labelStr.Text.Trim()))
                {
                    string[] strArray = this.labelStr.Text.Trim().Split(' ');
                    for (int index = 0; index < strArray.Length; ++index)
                    {
                        hnEkey.kbtn.kbKeys[index] = KBTable.getKey8Name(strArray[index]).keyCode;
                    }
                }

                if (hnEkey.kbtn.bCtrl == (byte)1 || hnEkey.kbtn.bAlt == (byte)1 ||
                    (hnEkey.kbtn.bShift == (byte)1 || hnEkey.kbtn.bWin == (byte)1) || hnEkey.kbtn.kbKeys.Length != 0)
                {
                    hnEkey.funcBit |= 4U;
                }
            }

            if (this.checkBoxFunMouse.Checked)
            {
                if (this.radioMouseLeft.Checked)
                {
                    hnEkey.funcBit |= 16U;
                }
                else if (this.radioMouseRight.Checked)
                {
                    hnEkey.funcBit |= 64U;
                }
                else if (this.radioMouseMid.Checked)
                {
                    hnEkey.funcBit |= 32U;
                }
                else if (this.radioMouseWheelForward.Checked)
                {
                    hnEkey.funcBit |= 128U;
                }
                else if (this.radioMouseWheelBackWard.Checked)
                {
                    hnEkey.funcBit |= 256U;
                }
            }

            if (this.checkBoxFunSwitch.Checked)
            {
                if (this.radioSwitchScreen.Checked)
                {
                    hnEkey.funcBit |= 1U;
                }
                else if (this.radioSwithBrush.Checked)
                {
                    hnEkey.funcBit |= 2U;
                }
            }

            if (this.checkBoxFunRun.Checked && !string.IsNullOrEmpty(this.labelPath.Text.Trim()))
            {
                hnEkey.funcBit |= 8U;
                this.labelPath.Text.ToCharArray().CopyTo((Array)hnEkey.cmdPath, 0);
            }

            // ISSUE: reference to a compiler-generated field
            this.callback(this.mHolder, hnEkey);
            this.Close();
        }
示例#7
0
 private string onKeyChangedListener(HuionKeyEventArgs keyEvent)
 {
     SettingsUtil.ShowUIShortcut = keyEvent;
     HuionDriverDLL.PostMessage(this.mMainFormHandle, 1064, IntPtr.Zero, IntPtr.Zero);
     return(KBTable.getKBTable8Keys(keyEvent.KeyCode).KeyName);
 }
示例#8
0
            public override string ToString()
            {
                if (this.funcBit == 0U)
                {
                    return(ResourceCulture.GetString("FormEkey_btUndefinedText"));
                }
                string str = (string)null;

                if (Convert.ToBoolean(this.funcBit & 4U))
                {
                    if (this.kbtn.bCtrl != (byte)0)
                    {
                        str += "Ctrl+";
                    }
                    if (this.kbtn.bAlt != (byte)0)
                    {
                        str += "Alt+";
                    }
                    if (this.kbtn.bShift != (byte)0)
                    {
                        str += "Shift+";
                    }
                    if (this.kbtn.bWin != (byte)0)
                    {
                        str += "Win+";
                    }
                    for (int index = 0; index < 16 && this.kbtn.kbKeys[index] != (byte)0; ++index)
                    {
                        str += KBTable.getKey8Code(this.kbtn.kbKeys[index]).ToString();
                    }
                }

                if (Convert.ToBoolean(this.funcBit & 16U))
                {
                    if (!string.IsNullOrEmpty(str))
                    {
                        str += ";";
                    }
                    str += ResourceCulture.GetString("FormEkey_rdMouseLeftText");
                }

                if (Convert.ToBoolean(this.funcBit & 32U))
                {
                    if (!string.IsNullOrEmpty(str))
                    {
                        str += ";";
                    }
                    str += ResourceCulture.GetString("FormEkey_rdMouseMidText");
                }

                if (Convert.ToBoolean(this.funcBit & 64U))
                {
                    if (!string.IsNullOrEmpty(str))
                    {
                        str += ";";
                    }
                    str += ResourceCulture.GetString("FormEkey_rdMouseRightText");
                }

                if (Convert.ToBoolean(this.funcBit & 128U))
                {
                    if (!string.IsNullOrEmpty(str))
                    {
                        str += ";";
                    }
                    str += ResourceCulture.GetString("FormEkey_rdMouseWheelForwardText");
                }

                if (Convert.ToBoolean(this.funcBit & 256U))
                {
                    if (!string.IsNullOrEmpty(str))
                    {
                        str += ";";
                    }
                    str += ResourceCulture.GetString("FormEkey_rdMouseWheelBackwardText");
                }

                if (Convert.ToBoolean(this.funcBit & 1U))
                {
                    if (!string.IsNullOrEmpty(str))
                    {
                        str += ";";
                    }
                    str += ResourceCulture.GetString("FormEkey_rdSwitchScreenText");
                }

                if (Convert.ToBoolean(this.funcBit & 2U))
                {
                    if (!string.IsNullOrEmpty(str))
                    {
                        str += ";";
                    }
                    str += ResourceCulture.GetString("FormEkey_rdSwitchBrushText");
                }

                if (Convert.ToBoolean(this.funcBit & 8U))
                {
                    if (!string.IsNullOrEmpty(str))
                    {
                        str += ";";
                    }
                    str += new string(this.cmdPath).Trim(new char[1]);
                }

                return(str ?? ResourceCulture.GetString("FormEkey_btUndefinedText"));
            }