// -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -



        // -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -
        private void generateKeyString()
        {
            if (lvKeys.SelectedItems.Count < 1)
            {
                MessageBox.Show("Please select a key first!");
                return;
            }

            string value = lvKeys.SelectedItems[0].SubItems[1].ToString();

            KeyStringBuilder ksb = new KeyStringBuilder();

            keyString = ksb.getKeyString(cbCtrl.Checked, cbAlt.Checked, cbShift.Checked, value);
            key       = value;
        }
        // -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -


        // -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -
        private void timerTickHandler(Object myObject, EventArgs myEventArgs)
        {
            t.log("CommandExecutionHandler.startTimedCommandItemExecution(): tickCount = " + tickCount);
            tickCount++;

            if (tickCount > cvo.commandItems.Count)
            {
                timer.Stop();
                tickCount = 0;
            }
            else
            {
                CommandItemVO civo = cvo.commandItems[(tickCount - 1)];
                t.log("CommandExecutionHandler.startTimedCommandItemExecution(): civo.type = " + civo.type);

                IntPtr handle;

                switch (civo.type)
                {
                case "clipboard":

                    Clipboard.SetText(civo.clipboard);
                    if (civo.clipboardAutoPaste)
                    {
                        handle = GetActiveWindow();
                        SendKeys.Send("^(v)");
                    }

                    break;

                case "key":
                    t.log("\t\t" + "civo.key = " + civo.key);
                    KeyStringBuilder ksb       = new KeyStringBuilder();
                    String           keyString = ksb.getKeyString(civo.ctrlPressed, civo.altPressed, civo.shiftPressed, civo.key);

                    handle = GetActiveWindow();
                    SendKeys.Send(keyString);

                    break;

                case "run application":
                    t.log("\t\t" + "civo.applicationPath = " + civo.applicationPath);
                    t.log("\t\t" + "civo.applicationParams = " + civo.applicationParams);
                    Process proc = Process.Start(civo.applicationPath, civo.applicationParams);
                    break;
                }
            }
        }