Пример #1
0
 private addCommand()
 {
     InitializeComponent();
     this.resourceType.SelectedIndex = this.resourceType.Items.IndexOf("文件");
     Command.Select(Command.Text.Length, 0);
     hi = new HintDialog();
 }
        public commandView()
        {
            InitializeComponent();
            ini     = new LoadConfig(Application.StartupPath + @"\command.ini");
            hi      = new HintDialog();
            loading = new Loading();
            InitList();
            if (AutoRun.isAutoRun(appName, Application.ExecutablePath))
            {
                startWithBoot.Checked = true;
            }
            else
            {
                startWithBoot.Checked = false;
            }
            _keyboardHook.InstallHook(KeyPress);
            delay           = new System.Timers.Timer(200);
            delay.Elapsed  += new System.Timers.ElapsedEventHandler(tick);
            delay.AutoReset = false;
            t            = new System.Timers.Timer(600);
            t.Elapsed   += new System.Timers.ElapsedEventHandler(typing);
            t.AutoReset  = false;
            lt           = new System.Timers.Timer(500);
            lt.Elapsed  += new System.Timers.ElapsedEventHandler(hideLoad);
            lt.AutoReset = false;

            //keycode值与String对应
            keycode.Add(48, "0");
            keycode.Add(49, "1");
            keycode.Add(50, "2");
            keycode.Add(51, "3");
            keycode.Add(52, "4");
            keycode.Add(53, "5");
            keycode.Add(54, "6");
            keycode.Add(55, "7");
            keycode.Add(56, "8");
            keycode.Add(57, "9");
            keycode.Add(188, ",");
            keycode.Add(190, ".");
            keycode.Add(191, "/");
            keycode.Add(186, "sm");
            keycode.Add(222, "'");
            keycode.Add(219, "lb");
            keycode.Add(221, "]");
            keycode.Add(220, "\\");
            keycode.Add(189, "-");
            keycode.Add(187, "eq");
        }