예제 #1
0
        private void tsbScan_Click(object sender, EventArgs e)
        {
            KB9TextBox t   = GetFocusedTextBox();
            frmAscii   frm = new frmAscii();
            string     s   = frm.InputAscii();

            if (s.Length <= 0)
            {
                return;
            }
            t.AddKeyCode(s, true);
        }
예제 #2
0
        private void tstMacro_Click(object sender, EventArgs e)
        {
            KB9TextBox t   = GetFocusedTextBox();
            frmMacro   frm = new frmMacro();
            string     s   = frm.input_macro(null);

            if (s == string.Empty)
            {
                return;
            }

            t.AddKeyCode(s, true);
        }
예제 #3
0
        private void tsmScan_Click(object sender, EventArgs e)
        {
            KB9TextBox t = GetFocusedTextBox();

            frmAscii frm     = new frmAscii();
            string   strscan = frm.InputAscii();

            if (strscan.Length > 0)
            {
                t.AddKeyCode(strscan, true);
            }
            //frm.ShowDialog();
        }
예제 #4
0
        private void tsbSpecial_Click(object sender, EventArgs e)
        {
            KB9TextBox     t   = GetFocusedTextBox();
            frmOnScreenKbd frm = new frmOnScreenKbd(true);

            frm.StartPosition = FormStartPosition.CenterParent;
            string s = frm.InputSpecialKey();

            // s = s.Replace("[", "");
            // s = s.Replace("]", "");
            if (s.Length <= 0)
            {
                return;
            }
            t.AddKeyCode(s, false);
        }
예제 #5
0
        private void tsmCombination_Click(object sender, EventArgs e)
        {
            KB9TextBox t = GetFocusedTextBox();

            if (t == null)
            {
                return;
            }
            frmCombination frm = new frmCombination();
            string         s   = frm.InputCombinationKeys();

            if (s.Length > 0)
            {
                t.AddKeyCode(s, true);
            }
        }
예제 #6
0
        private void tsmRepeat_Click(object sender, EventArgs e)
        {
            KB9TextBox t   = GetFocusedTextBox();
            frmRepeat  frm = new frmRepeat();
            int        n   = frm.InputRepeat();

            if (n <= 0)
            {
                return;
            }


            string s = n.ToString();

            s = "Repeat" + s;
            t.AddKeyCode(s, true);
        }
예제 #7
0
        private void tsbLevel_Click(object sender, EventArgs e)
        {
            KB9TextBox t = GetFocusedTextBox();

            if (t == null)
            {
                return;
            }
            frmLayers frm = new frmLayers();
            string    s   = frm.input_layer(t.Text);

            if (s == string.Empty)
            {
                return;
            }

            t.AddKeyCode(s, false);
        }
예제 #8
0
        static public bool ValidateKeyTextBox(Form frmCaller, KB9TextBox ctrlText)
        {
            string strKeys = ctrlText.Text;// GetInputedKeyCodes();

            if (strKeys == string.Empty)
            {
                return(true);
            }
            KB9Validation kb9 = new KB9Validation();

            KB9Validation.ERR_VALIDATION err = kb9.ValidateKB9Keycodes(strKeys);
            if (err == KB9Validation.ERR_VALIDATION.OK)
            {
                return(true);
            }

            string err_msg = ValidateErrMsg(err);

            if (err == KB9Validation.ERR_VALIDATION.Less_AltUp ||
                err == KB9Validation.ERR_VALIDATION.Less_RAltUp ||
                err == KB9Validation.ERR_VALIDATION.Less_CtrlUp ||
                err == KB9Validation.ERR_VALIDATION.Less_RCtrlUp ||
                err == KB9Validation.ERR_VALIDATION.Less_RShiftUp ||
                err == KB9Validation.ERR_VALIDATION.Less_ShiftUp ||
                err == KB9Validation.ERR_VALIDATION.Less_WinUp ||
                err == KB9Validation.ERR_VALIDATION.Less_RWinUp)
            {
                err_msg += "\n\rDo you want utility append this key to end?";

                DialogResult result = MessageBox.Show(frmCaller, err_msg, "Error", MessageBoxButtons.YesNo, MessageBoxIcon.Error);
                if (result == DialogResult.Yes)
                {
                    string strAppend = AppendErrKey(err);
                    ctrlText.AddKeyCode(strAppend, false);
                }
            }
            else
            {
                err_msg += "\n\rPlease fixed it manually.";
                MessageBox.Show(frmCaller, err_msg, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

            return(false);
        }
예제 #9
0
        private void tsbRepeat_Click(object sender, EventArgs e)
        {
            frmOnScreenKbd.Instance().Hide();
            KB9TextBox t = GetFocusedTextBox();

            if (t == null)
            {
                return;
            }
            frmRepeat frm = new frmRepeat();
            int       n   = frm.InputRepeat();

            if (n <= 0)
            {
                return;
            }


            string s = n.ToString();

            s = "Repeat" + s;
            t.AddKeyCode(s, true);
        }
예제 #10
0
        private void tsmDelay_Click(object sender, EventArgs e)
        {
            KB9TextBox t   = GetFocusedTextBox();
            frmDelay   frm = new frmDelay();
            decimal    d   = frm.InputDelay();

            if (d <= 0)
            {
                return;
            }

            /*
             * d *= 10; //delay time is nx0.1 format, so need to x10 to make string
             * int n = (int)d;
             * string s = n.ToString();
             *
             * s = "Pause" + s;
             * */
            string s = frmDelay.makePauseString(d);

            t.AddKeyCode(s, true);
            //frm.ShowDialog();
        }
예제 #11
0
        private void tsbDelay_Click(object sender, EventArgs e)
        {
            frmOnScreenKbd.Instance().Hide();
            KB9TextBox t = GetFocusedTextBox();

            if (t == null)
            {
                return;
            }
            frmDelay frm = new frmDelay();
            decimal  d   = frm.InputDelay();

            if (d <= 0)
            {
                return;
            }
            //d *= 10; //delay time is nx0.1 format, so need to x10 to make string
            //int n = (int)d;
            //string s = n.ToString();
            //s = "Pause" + s;
            string s = frmDelay.makePauseString(d);

            t.AddKeyCode(s, true);
        }