コード例 #1
0
ファイル: Form1.cs プロジェクト: Norbert94/TwitchMarker
        public Form1()
        {

            InitializeComponent();
            this.ShowInTaskbar = false;

            if (TwitchMarker.Properties.Settings.Default.hotkey != Keys.None)
            {
                //ghk = new KeyHandler(TwitchMarker.Properties.Settings.Default.hotkey, this);
                savedHotkey = TwitchMarker.Properties.Settings.Default.hotkey;
                setKey(TwitchMarker.Properties.Settings.Default.hotkey);
                ghk.Register();
            }
            else
            {
                ghk = new KeyHandler(Keys.F11, this);
                txt_hotkey.Text = "F11";
                ghk.Register();
            }
            if (TwitchMarker.Properties.Settings.Default.channel != "")
            {
                txt_Name.Text = TwitchMarker.Properties.Settings.Default.channel;
                savedChannel = txt_Name.Text;
                newThread();
            }
        }
コード例 #2
0
        private void setKey(Keys e)
        {
            switch (e)
            {
            case Keys.F1:
                ghk             = new KeyHandler(Keys.F1, this);
                txt_hotkey.Text = "F1";
                TwitchMarker.Properties.Settings.Default.hotkey = Keys.F1;
                break;

            case Keys.F2:
                ghk             = new KeyHandler(Keys.F2, this);
                txt_hotkey.Text = "F2";
                TwitchMarker.Properties.Settings.Default.hotkey = Keys.F2;
                break;

            case Keys.F3:
                ghk             = new KeyHandler(Keys.F3, this);
                txt_hotkey.Text = "F3";
                TwitchMarker.Properties.Settings.Default.hotkey = Keys.F3;
                break;

            case Keys.F4:
                ghk             = new KeyHandler(Keys.F4, this);
                txt_hotkey.Text = "F4";
                TwitchMarker.Properties.Settings.Default.hotkey = Keys.F4;
                break;

            case Keys.F5:
                ghk             = new KeyHandler(Keys.F5, this);
                txt_hotkey.Text = "F5";
                TwitchMarker.Properties.Settings.Default.hotkey = Keys.F5;
                break;

            case Keys.F6:
                ghk             = new KeyHandler(Keys.F6, this);
                txt_hotkey.Text = "F6";
                TwitchMarker.Properties.Settings.Default.hotkey = Keys.F6;
                break;

            case Keys.F7:
                ghk             = new KeyHandler(Keys.F7, this);
                txt_hotkey.Text = "F7";
                TwitchMarker.Properties.Settings.Default.hotkey = Keys.F7;
                break;

            case Keys.F8:
                ghk             = new KeyHandler(Keys.F8, this);
                txt_hotkey.Text = "F8";
                TwitchMarker.Properties.Settings.Default.hotkey = Keys.F8;
                break;

            case Keys.F9:
                ghk             = new KeyHandler(Keys.F9, this);
                txt_hotkey.Text = "F9";
                TwitchMarker.Properties.Settings.Default.hotkey = Keys.F9;
                break;

            case Keys.F10:
                ghk             = new KeyHandler(Keys.F10, this);
                txt_hotkey.Text = "F10";
                TwitchMarker.Properties.Settings.Default.hotkey = Keys.F10;
                break;

            case Keys.F11:
                ghk             = new KeyHandler(Keys.F11, this);
                txt_hotkey.Text = "F11";
                TwitchMarker.Properties.Settings.Default.hotkey = Keys.F11;
                break;

            case Keys.F12:
                ghk             = new KeyHandler(Keys.F12, this);
                txt_hotkey.Text = "F12";
                TwitchMarker.Properties.Settings.Default.hotkey = Keys.F12;
                break;
            }
        }
コード例 #3
0
ファイル: Form1.cs プロジェクト: Norbert94/TwitchMarker
 private void setKey(Keys e)
 {
     switch (e)
     {
         case Keys.F1:
             ghk = new KeyHandler(Keys.F1, this);
             txt_hotkey.Text = "F1";
             TwitchMarker.Properties.Settings.Default.hotkey = Keys.F1;
             break;
         case Keys.F2:
             ghk = new KeyHandler(Keys.F2, this);
             txt_hotkey.Text = "F2";
             TwitchMarker.Properties.Settings.Default.hotkey = Keys.F2;
             break;
         case Keys.F3:
             ghk = new KeyHandler(Keys.F3, this);
             txt_hotkey.Text = "F3";
             TwitchMarker.Properties.Settings.Default.hotkey = Keys.F3;
             break;
         case Keys.F4:
             ghk = new KeyHandler(Keys.F4, this);
             txt_hotkey.Text = "F4";
             TwitchMarker.Properties.Settings.Default.hotkey = Keys.F4;
             break;
         case Keys.F5:
             ghk = new KeyHandler(Keys.F5, this);
             txt_hotkey.Text = "F5";
             TwitchMarker.Properties.Settings.Default.hotkey = Keys.F5;
             break;
         case Keys.F6:
             ghk = new KeyHandler(Keys.F6, this);
             txt_hotkey.Text = "F6";
             TwitchMarker.Properties.Settings.Default.hotkey = Keys.F6;
             break;
         case Keys.F7:
             ghk = new KeyHandler(Keys.F7, this);
             txt_hotkey.Text = "F7";
             TwitchMarker.Properties.Settings.Default.hotkey = Keys.F7;
             break;
         case Keys.F8:
             ghk = new KeyHandler(Keys.F8, this);
             txt_hotkey.Text = "F8";
             TwitchMarker.Properties.Settings.Default.hotkey = Keys.F8;
             break;
         case Keys.F9:
             ghk = new KeyHandler(Keys.F9, this);
             txt_hotkey.Text = "F9";
             TwitchMarker.Properties.Settings.Default.hotkey = Keys.F9;
             break;
         case Keys.F10:
             ghk = new KeyHandler(Keys.F10, this);
             txt_hotkey.Text = "F10";
             TwitchMarker.Properties.Settings.Default.hotkey = Keys.F10;
             break;
         case Keys.F11:
             ghk = new KeyHandler(Keys.F11, this);
             txt_hotkey.Text = "F11";
             TwitchMarker.Properties.Settings.Default.hotkey = Keys.F11;
             break;
         case Keys.F12:
             ghk = new KeyHandler(Keys.F12, this);
             txt_hotkey.Text = "F12";
             TwitchMarker.Properties.Settings.Default.hotkey = Keys.F12;
             break;
     }
 }
コード例 #4
0
ファイル: Form1.cs プロジェクト: Norbert94/TwitchMarker
        private void cancel_btn_Click(object sender, EventArgs e)
        {
            if (txt_hotkey.Text == "F11")
            {
                ghk = new KeyHandler(Keys.F11, this);
                txt_hotkey.Text = "F11";
                ghk.Register();
            }

            txt_Name.Text = savedChannel;
            setKey(savedHotkey);

            this.Location = new Point(this.Location.X, this.Location.Y - 5000);
        }