Ejemplo n.º 1
0
 public configform()
 {
     InitializeComponent();
     FileIO io = new FileIO("./config.txt");
     io.read_custom();
     foreach (string line in FileIO.lines)
     {
         if (line.Trim() != "" && line.Trim().IndexOf('%')!=0)
         {
             string[] new_shortcut = line.Split(null as string[], StringSplitOptions.RemoveEmptyEntries); //pass white space for splitting
             config_shortcuts tmp = new config_shortcuts(new_shortcut[0], new_shortcut[1]);
             config_map.Add(tmp);
             checkedListBox1.Items.Add(new_shortcut[0]);
         }
     }
 }
Ejemplo n.º 2
0
        /*       private void Create_altf4()
        {
            Button altf4_key = new Button();
            altf4_key.Location = new System.Drawing.Point(12, position_base);
            altf4_key.Name = "altf4_key";
            altf4_key.Size = new System.Drawing.Size(198, 34);
            altf4_key.TabIndex = 3;
            altf4_key.Text = "alt+f4";
            altf4_key.UseVisualStyleBackColor = true;
            this.Controls.Add(altf4_key);
            altf4_key.Click += new EventHandler(btn_Click);
            position_base += 44;

        }

        private void Create_backspace()
        {
            Button backspace_key = new Button();
            backspace_key.Location = new System.Drawing.Point(12, position_base);
            backspace_key.Name = "backspace_key";
            backspace_key.Size = new System.Drawing.Size(198, 34);
            backspace_key.TabIndex = 3;
            backspace_key.Text = "backspace";
            backspace_key.UseVisualStyleBackColor = true;
            this.Controls.Add(backspace_key);
            backspace_key.Click += new EventHandler(btn_Click);
            position_base += 44;

        }
        private void Create_ctrlv()
        {

            Button ctrlv_key = new Button();
            ctrlv_key.Location = new System.Drawing.Point(12, position_base);
            ctrlv_key.Name = "ctrlv_key";
            ctrlv_key.Size = new System.Drawing.Size(198, 34);
            ctrlv_key.TabIndex = 3;
            ctrlv_key.Text = "ctrl+v";
            ctrlv_key.UseVisualStyleBackColor = true;
            this.Controls.Add(ctrlv_key);
            ctrlv_key.Click += new EventHandler(btn_Click);
            position_base += 44;
        }
        private void Create_ctrlc()
        {
            Button ctrlc_key = new Button();
            ctrlc_key.Location = new System.Drawing.Point(12, position_base);
            ctrlc_key.Name = "ctrlc_key";
            ctrlc_key.Size = new System.Drawing.Size(198, 34);
            ctrlc_key.TabIndex = 3;
            ctrlc_key.Text = "ctrl+c";
            ctrlc_key.UseVisualStyleBackColor = true;
            this.Controls.Add(ctrlc_key);
            ctrlc_key.Click += new EventHandler(btn_Click);
            position_base += 44;
        }*/
        private void Create_config(config_shortcuts shortcut)
        {
            Button config_key = new Button();
            config_key.Location = new System.Drawing.Point(12, position_base);
            config_key.Name = shortcut.name;
            config_key.Size = new System.Drawing.Size(120, 44);
            config_key.TabIndex = 3;
            config_key.Text = shortcut.name;
            config_key.UseVisualStyleBackColor = true;
            this.Controls.Add(config_key);
            config_key.Click += new EventHandler(btn_Click);

            position_base += 46;
        }