Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- using System.Runtime.InteropServices;
- using System.Diagnostics;
- using System.IO;
- namespace SAMPBinder
- {
- public partial class Form1 : Form
- {
- #region userdll
- #region asynckey
- [DllImport("user32.dll")]
- static extern short GetAsyncKeyState(System.Windows.Forms.Keys vKey);
- public bool pressed(Keys key)
- {
- if (GetAsyncKeyState(key) == 0)
- return false;
- else
- return true;
- }
- #endregion
- [DllImport("user32.dll")]
- private static extern IntPtr GetForegroundWindow();
- [DllImport("user32.dll", SetLastError = true)]
- static extern IntPtr FindWindow(string lpClassName, string lpWindowName);
- [DllImport("user32", SetLastError = true)]
- [return: MarshalAs(UnmanagedType.Bool)]
- public static extern bool RegisterHotKey(IntPtr hwnd, int id, uint fsModifiers, uint vk);
- [DllImport("user32", SetLastError = true)]
- [return: MarshalAs(UnmanagedType.Bool)]
- public static extern bool UnregisterHotKey(IntPtr hwnd, int id);
- public static uint nimic = 0x0;
- public static int WM_HOTKEY = 0x312;
- public static uint MOD_SHIFT = 0x4;
- public static uint MOD_CONTROL = 0x2;
- #endregion
- public Form1()
- {
- InitializeComponent();
- }
- private void Form1_Load(object sender, EventArgs e)
- {
- update.Start();
- incarca_setari();
- }
- #region declaratii variabile
- bool tastaESC = false;
- bool tastaENTER = false;
- bool chat_inchis = true;
- bool on = true;
- bool TT = false;
- bool smoth = true; // daca se misca frumos in jos/sus
- bool doar_gta = true;
- int ind = 5; // indexul
- int[] taste = new int[21]; // tastele
- #region binduri
- bool bind1 = false;
- bool bind2 = false;
- bool bind3 = false;
- bool bind4 = false;
- bool bind5 = false;
- bool bind6 = false;
- bool bind7 = false;
- bool bind8 = false;
- bool bind9 = false;
- bool bind10 = false;
- bool bind11 = false;
- bool bind12 = false;
- bool bind13 = false;
- bool bind14 = false;
- bool bind15 = false;
- bool bind16 = false;
- bool bind17 = false;
- bool bind18 = false;
- bool bind19 = false;
- bool bind20 = false;
- #endregion
- #endregion
- #region functii
- void caz(string text)
- {
- try
- {
- string mes = text;
- mes = mes.Replace("(","{(}");
- mes = mes.Replace(")", "{)}");
- mes = mes.Replace("~", "{~}");
- SendKeys.Send(mes);
- }
- catch (Exception ex)
- {
- MessageBox.Show(ex.Message.ToString(), "Error");
- }
- }
- void regkeys(int i, int tasta, bool bind)
- {
- bool ok = false;
- IntPtr a = GetForegroundWindow();
- IntPtr b = FindWindow(null, "GTA:SA:MP");
- if (a == b)
- ok = true;
- if (doar_gta)
- if (bind && ok && on &&chat_inchis)
- {
- RegisterHotKey(this.Handle, i, nimic, (uint)((Keys)tasta));
- }
- else
- UnregisterHotKey(this.Handle, i);
- else
- if (bind && on)
- {
- RegisterHotKey(this.Handle, i, nimic, (uint)((Keys)tasta));
- }
- else
- UnregisterHotKey(this.Handle, i);
- } // inregistreaza / sterge bind
- bool diferit(string a, string b)
- {
- if (a != "" && b != "None(0)")
- return true;
- else
- return false;
- }
- void update_v_taste()
- {
- taste[1] = Properties.Settings.Default.tasta1;
- taste[2] = Properties.Settings.Default.tasta2;
- taste[3] = Properties.Settings.Default.tasta3;
- taste[4] = Properties.Settings.Default.tasta4;
- taste[5] = Properties.Settings.Default.tasta5;
- taste[6] = Properties.Settings.Default.tasta6;
- taste[7] = Properties.Settings.Default.tasta7;
- taste[8] = Properties.Settings.Default.tasta8;
- taste[9] = Properties.Settings.Default.tasta9;
- taste[10] = Properties.Settings.Default.tasta10;
- taste[11] = Properties.Settings.Default.tasta11;
- taste[12] = Properties.Settings.Default.tasta12;
- taste[13] = Properties.Settings.Default.tasta13;
- taste[14] = Properties.Settings.Default.tasta14;
- taste[15] = Properties.Settings.Default.tasta15;
- taste[16] = Properties.Settings.Default.tasta16;
- taste[17] = Properties.Settings.Default.tasta17;
- taste[18] = Properties.Settings.Default.tasta18;
- taste[19] = Properties.Settings.Default.tasta19;
- taste[20] = Properties.Settings.Default.tasta20;
- } // updatezi tastele
- void update_ind()
- {
- Properties.Settings.Default.index = ind;
- Properties.Settings.Default.Save();
- } // updatezi indexul ( nr de binduri)
- void in_jos()
- {
- timer2.Stop();
- if (ind ==1)
- {
- if (this.Size.Height < 179)
- {
- this.Size = new Size(this.Size.Width, this.Size.Height + 1);
- }
- else
- {
- ind++;update_ind();
- timer1.Stop();
- }
- }
- if (ind ==2)
- {
- if (this.Size.Height < 224)
- {
- this.Size = new Size(this.Size.Width, this.Size.Height + 1);
- }
- else
- {
- ind++;update_ind();
- timer1.Stop();
- }
- }
- if (ind == 3)
- {
- if (this.Size.Height < 264)
- {
- this.Size = new Size(this.Size.Width, this.Size.Height + 1);
- }
- else
- {
- ind++;update_ind();
- timer1.Stop();
- }
- }
- if (ind == 4)
- {
- if (this.Size.Height < 304)
- {
- this.Size = new Size(this.Size.Width, this.Size.Height + 1);
- }
- else
- {
- ind++;update_ind();
- timer1.Stop();
- }
- }
- if (ind == 5)
- {
- if (this.Size.Height < 346)
- {
- this.Size = new Size(this.Size.Width, this.Size.Height + 1);
- }
- else
- {
- ind++;update_ind();
- timer1.Stop();
- }
- }
- if (ind == 6)
- {
- if (this.Size.Height < 392)
- {
- this.Size = new Size(this.Size.Width, this.Size.Height + 1);
- }
- else
- {
- ind++;update_ind();
- timer1.Stop();
- }
- }
- if (ind == 7)
- {
- if (this.Size.Height < 432)
- {
- this.Size = new Size(this.Size.Width, this.Size.Height + 1);
- }
- else
- {
- ind++;update_ind();
- timer1.Stop();
- }
- }
- if (ind == 8)
- {
- if (this.Size.Height < 467)
- {
- this.Size = new Size(this.Size.Width, this.Size.Height + 1);
- }
- else
- {
- ind++;update_ind();
- timer1.Stop();
- }
- }
- if (ind == 9)
- {
- if (this.Size.Height < 512)
- {
- this.Size = new Size(this.Size.Width, this.Size.Height + 1);
- }
- else
- {
- ind++;update_ind();
- timer1.Stop();
- }
- }
- } // miscarea in jos nr de binduri
- void in_sus()
- {
- timer1.Stop();
- if (ind == 10)
- {
- if (this.Size.Height > 467)
- {
- this.Size = new Size(this.Size.Width, this.Size.Height - 1);
- }
- else
- {
- ind--;update_ind();
- timer2.Stop();
- }
- }
- if (ind == 9)
- {
- if (this.Size.Height > 432)
- {
- this.Size = new Size(this.Size.Width, this.Size.Height - 1);
- }
- else
- {
- ind--;update_ind();
- timer2.Stop();
- }
- }
- if (ind == 8)
- {
- if (this.Size.Height > 392)
- {
- this.Size = new Size(this.Size.Width, this.Size.Height - 1);
- }
- else
- {
- ind--;update_ind();
- timer2.Stop();
- }
- }
- if (ind == 7)
- {
- if (this.Size.Height > 346)
- {
- this.Size = new Size(this.Size.Width, this.Size.Height - 1);
- }
- else
- {
- ind--;update_ind();
- timer2.Stop();
- }
- }
- if (ind == 6)
- {
- if (this.Size.Height > 304)
- {
- this.Size = new Size(this.Size.Width, this.Size.Height - 1);
- }
- else
- {
- ind--;update_ind();
- timer2.Stop();
- }
- }
- if (ind == 5)
- {
- if (this.Size.Height > 264)
- {
- this.Size = new Size(this.Size.Width, this.Size.Height - 1);
- }
- else
- {
- ind--;update_ind();
- timer2.Stop();
- }
- }
- if (ind == 4)
- {
- if (this.Size.Height > 224)
- {
- this.Size = new Size(this.Size.Width, this.Size.Height - 1);
- }
- else
- {
- ind--;update_ind();
- timer2.Stop();
- }
- }
- if (ind == 3)
- {
- if (this.Size.Height > 179)
- {
- this.Size = new Size(this.Size.Width, this.Size.Height - 1);
- }
- else
- {
- ind--;update_ind();
- timer2.Stop();
- }
- }
- if (ind == 2)
- {
- if (this.Size.Height > 134)
- {
- this.Size = new Size(this.Size.Width, this.Size.Height - 1);
- }
- else
- {
- ind--;update_ind();
- timer2.Stop();
- }
- }
- } // miscarea in sus nr de binduri
- void incarca_setari()
- {
- #region r only
- enab = Properties.Settings.Default.enab;
- if (!enab)
- {
- toolStripStatusLabel5.Text = "Disable Read Only";
- hk1.Enabled = false;
- hk2.Enabled = false;
- hk3.Enabled = false;
- hk4.Enabled = false;
- hk5.Enabled = false;
- hk6.Enabled = false;
- hk7.Enabled = false;
- hk8.Enabled = false;
- hk9.Enabled = false;
- hk10.Enabled = false;
- hk11.Enabled = false;
- hk12.Enabled = false;
- hk13.Enabled = false;
- hk14.Enabled = false;
- hk15.Enabled = false;
- hk16.Enabled = false;
- hk17.Enabled = false;
- hk18.Enabled = false;
- hk19.Enabled = false;
- hk20.Enabled = false;
- text1.Enabled = false;
- text2.Enabled = false;
- text3.Enabled = false;
- text4.Enabled = false;
- text5.Enabled = false;
- text6.Enabled = false;
- text7.Enabled = false;
- text8.Enabled = false;
- text9.Enabled = false;
- text10.Enabled = false;
- text11.Enabled = false;
- text12.Enabled = false;
- text13.Enabled = false;
- text14.Enabled = false;
- text15.Enabled = false;
- text16.Enabled = false;
- text17.Enabled = false;
- text18.Enabled = false;
- text19.Enabled = false;
- text20.Enabled = false;
- }
- else
- {
- toolStripStatusLabel5.Text = "Enable Read Only";
- hk1.Enabled = true;
- hk2.Enabled = true;
- hk3.Enabled = true;
- hk4.Enabled = true;
- hk5.Enabled = true;
- hk6.Enabled = true;
- hk7.Enabled = true;
- hk8.Enabled = true;
- hk9.Enabled = true;
- hk10.Enabled = true;
- hk11.Enabled = true;
- hk12.Enabled = true;
- hk13.Enabled = true;
- hk14.Enabled = true;
- hk15.Enabled = true;
- hk16.Enabled = true;
- hk17.Enabled = true;
- hk18.Enabled = true;
- hk19.Enabled = true;
- hk20.Enabled = true;
- text1.Enabled = true;
- text2.Enabled = true;
- text3.Enabled = true;
- text4.Enabled = true;
- text5.Enabled = true;
- text6.Enabled = true;
- text7.Enabled = true;
- text8.Enabled = true;
- text9.Enabled = true;
- text10.Enabled = true;
- text11.Enabled = true;
- text12.Enabled = true;
- text13.Enabled = true;
- text14.Enabled = true;
- text15.Enabled = true;
- text16.Enabled = true;
- text17.Enabled = true;
- text18.Enabled = true;
- text19.Enabled = true;
- text20.Enabled = true;
- }
- #endregion
- #region creare fisier readme
- string s = Environment.NewLine;
- /* string mesaj = "";
- mesaj += "********* Universal KeyBinder v1.0 ********" + s;
- mesaj += "********* This is a freeware. ********" + s;
- mesaj += s+s+s+s+"What you need to know:" + s;
- mesaj += " - if you want to disable a bind press press Delete when choosing the hotkey " + s;
- mesaj += " - if you want to disable all binds press disable binds" + s;
- mesaj += s+s+s+s+"Features:" + s;
- mesaj += " - you can bind up to 20 keys" + s;
- mesaj += " - you can choose the hotkey very eazy by pressing it" + s;
- mesaj += " - you can use this as a SA:MP Keybinder or as an universal keybinder " + s;
- mesaj += " - if you are using this as a SA:MP Keybinder if the chat is open the keys won't be send " + s;
- mesaj += " - if you don't like to see that many binds you can hide them, this automaticaly disables them" + s;
- mesaj += " - every bind will be saved, and alo the hotkey" + s;
- mesaj += " - all the setings you make will be saved" + s;
- mesaj += s+s+s+s+"Info: " + s;
- mesaj += " -this program was made using Visual C# " + s;
- mesaj += " -for the hotkey I used the RegisterHotkey function from user32.dll " + s;
- mesaj += " -to find out if the current window is GTA I used GetForegroundWindow and FindWindow, also from user32.dll " + s;
- mesaj += s+s+s+"Enjoy it!";*/
- try
- {
- string nume = "WhyYUNoReadMe.txt";
- string mesaj = Properties.Resources.WhyYUNOReadMez;
- if (!File.Exists(nume))
- {
- StreamWriter sr = new StreamWriter(nume);
- sr.Write(mesaj);
- sr.Close();
- }
- }
- catch (Exception ex)
- {
- }
- #endregion
- #region smoth/rapid
- smoth = Properties.Settings.Default.smoth;
- if (smoth)
- {
- directlyToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Unchecked;
- smoothToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked;
- }
- else
- {
- directlyToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked;
- smoothToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Unchecked;
- }
- #endregion
- #region gta/anywin
- doar_gta = Properties.Settings.Default.doargta;
- if (doar_gta)
- {
- justgta.CheckState = System.Windows.Forms.CheckState.Checked;
- anywin.CheckState = System.Windows.Forms.CheckState.Unchecked;
- }
- else
- {
- anywin.CheckState = System.Windows.Forms.CheckState.Checked;
- justgta.CheckState = System.Windows.Forms.CheckState.Unchecked;
- }
- #endregion
- #region index
- ind = Properties.Settings.Default.index;
- if (ind == 1)
- this.Size = new Size(this.Size.Width, 134);
- if (ind == 2)
- this.Size = new Size(this.Size.Width, 179);
- if (ind == 3)
- this.Size = new Size(this.Size.Width, 224);
- if (ind == 4)
- this.Size = new Size(this.Size.Width, 264);
- if (ind == 5)
- this.Size = new Size(this.Size.Width, 304);
- if (ind == 6)
- this.Size = new Size(this.Size.Width, 346);
- if (ind == 7)
- this.Size = new Size(this.Size.Width, 392);
- if (ind == 8)
- this.Size = new Size(this.Size.Width, 432);
- if (ind == 9)
- this.Size = new Size(this.Size.Width, 467);
- if (ind == 10)
- this.Size = new Size(this.Size.Width, 506);
- #endregion
- #region taste
- int i; string ii;
- i = Properties.Settings.Default.tasta1;
- ii = ((Keys)i).ToString();
- hk1.Text = ii + "(" + i + ")";
- i = Properties.Settings.Default.tasta2;
- ii = ((Keys)i).ToString();
- hk2.Text = ii + "(" + i + ")";
- i = Properties.Settings.Default.tasta3;
- ii = ((Keys)i).ToString();
- hk3.Text = ii + "(" + i + ")";
- i = Properties.Settings.Default.tasta4;
- ii = ((Keys)i).ToString();
- hk4.Text = ii + "(" + i + ")";
- i = Properties.Settings.Default.tasta5;
- ii = ((Keys)i).ToString();
- hk5.Text = ii + "(" + i + ")";
- i = Properties.Settings.Default.tasta6;
- ii = ((Keys)i).ToString();
- hk6.Text = ii + "(" + i + ")";
- i = Properties.Settings.Default.tasta7;
- ii = ((Keys)i).ToString();
- hk7.Text = ii + "(" + i + ")";
- i = Properties.Settings.Default.tasta8;
- ii = ((Keys)i).ToString();
- hk8.Text = ii + "(" + i + ")";
- i = Properties.Settings.Default.tasta9;
- ii = ((Keys)i).ToString();
- hk9.Text = ii + "(" + i + ")";
- i = Properties.Settings.Default.tasta10;
- ii = ((Keys)i).ToString();
- hk10.Text = ii + "(" + i + ")";
- i = Properties.Settings.Default.tasta11;
- ii = ((Keys)i).ToString();
- hk11.Text = ii + "(" + i + ")";
- i = Properties.Settings.Default.tasta12;
- ii = ((Keys)i).ToString();
- hk12.Text = ii + "(" + i + ")";
- i = Properties.Settings.Default.tasta13;
- ii = ((Keys)i).ToString();
- hk13.Text = ii + "(" + i + ")";
- i = Properties.Settings.Default.tasta14;
- ii = ((Keys)i).ToString();
- hk14.Text = ii + "(" + i + ")";
- i = Properties.Settings.Default.tasta15;
- ii = ((Keys)i).ToString();
- hk15.Text = ii + "(" + i + ")";
- i = Properties.Settings.Default.tasta16;
- ii = ((Keys)i).ToString();
- hk16.Text = ii + "(" + i + ")";
- i = Properties.Settings.Default.tasta17;
- ii = ((Keys)i).ToString();
- hk17.Text = ii + "(" + i + ")";
- i = Properties.Settings.Default.tasta18;
- ii = ((Keys)i).ToString();
- hk18.Text = ii + "(" + i + ")";
- i = Properties.Settings.Default.tasta19;
- ii = ((Keys)i).ToString();
- hk19.Text = ii + "(" + i + ")";
- i = Properties.Settings.Default.tasta20;
- ii = ((Keys)i).ToString();
- hk20.Text = ii + "(" + i + ")";
- #endregion
- #region text
- text1.Text = Properties.Settings.Default.text1;
- text2.Text = Properties.Settings.Default.text2;
- text3.Text = Properties.Settings.Default.text3;
- text4.Text = Properties.Settings.Default.text4;
- text5.Text = Properties.Settings.Default.text5;
- text6.Text = Properties.Settings.Default.text6;
- text7.Text = Properties.Settings.Default.text7;
- text8.Text = Properties.Settings.Default.text8;
- text9.Text = Properties.Settings.Default.text9;
- text10.Text = Properties.Settings.Default.text10;
- text11.Text = Properties.Settings.Default.text11;
- text12.Text = Properties.Settings.Default.text12;
- text13.Text = Properties.Settings.Default.text13;
- text14.Text = Properties.Settings.Default.text14;
- text15.Text = Properties.Settings.Default.text15;
- text16.Text = Properties.Settings.Default.text16;
- text17.Text = Properties.Settings.Default.text17;
- text18.Text = Properties.Settings.Default.text18;
- text19.Text = Properties.Settings.Default.text19;
- text20.Text = Properties.Settings.Default.text20;
- #endregion;
- }
- #endregion
- #region eventuri sus+jos
- private void timer1_Tick(object sender, EventArgs e)
- {
- in_jos();
- }
- private void toolStripStatusLabel1_Click(object sender, EventArgs e)
- {
- if (smoth)
- {
- timer1.Stop();
- timer2.Stop();
- timer1.Start();
- }
- else
- {
- timer1.Stop();
- timer2.Stop();
- if (ind == 1)
- {
- this.Size = new Size(this.Size.Width, 179);
- ind++;update_ind();
- return;
- }
- if (ind == 2)
- {
- this.Size = new Size(this.Size.Width, 224);
- ind++;update_ind(); return;
- }
- if (ind == 3)
- {
- this.Size = new Size(this.Size.Width, 264);
- ind++;update_ind(); return;
- }
- if (ind == 4)
- {
- this.Size = new Size(this.Size.Width, 304);
- ind++;update_ind(); return;
- }
- if (ind == 5)
- {
- this.Size = new Size(this.Size.Width, 346);
- ind++;update_ind(); return;
- }
- if (ind == 6)
- {
- this.Size = new Size(this.Size.Width, 392);
- ind++;update_ind(); return;
- }
- if (ind == 7)
- {
- this.Size = new Size(this.Size.Width, 432);
- ind++;update_ind(); return;
- }
- if (ind == 8)
- {
- this.Size = new Size(this.Size.Width, 467);
- ind++;update_ind(); return;
- }
- if (ind == 9)
- {
- this.Size = new Size(this.Size.Width, 512);
- ind++;update_ind(); return;
- }
- }
- }
- private void textjos2_Click(object sender, EventArgs e)
- {
- if (smoth)
- {
- timer1.Stop();
- timer2.Stop();
- timer2.Start();
- }
- else
- {
- timer1.Stop();
- timer2.Stop();
- if (ind == 10)
- {
- this.Size = new Size(this.Size.Width, 467);
- ind--;update_ind();
- return;
- }
- if (ind == 9)
- {
- this.Size = new Size(this.Size.Width, 432);
- ind--;update_ind();
- return;
- }
- if (ind == 8)
- {
- this.Size = new Size(this.Size.Width, 392);
- ind--;update_ind();
- return;
- }
- if (ind == 7)
- {
- this.Size = new Size(this.Size.Width, 346);
- ind--;update_ind();
- return;
- }
- if (ind == 6)
- {
- this.Size = new Size(this.Size.Width, 304);
- ind--;update_ind();
- return;
- }
- if (ind == 5)
- {
- this.Size = new Size(this.Size.Width, 264);
- ind--;update_ind();
- return;
- }
- if (ind == 4)
- {
- this.Size = new Size(this.Size.Width, 224);
- ind--;update_ind();
- return;
- }
- if (ind == 3)
- {
- this.Size = new Size(this.Size.Width, 179);
- ind--;update_ind();
- return;
- }
- if (ind == 2)
- {
- this.Size = new Size(this.Size.Width, 134);
- ind--;update_ind();
- return;
- }
- }
- }
- private void timer2_Tick(object sender, EventArgs e)
- {
- in_sus();
- }
- #endregion
- #region eventuri intrare, iesire maus jos
- private void textjos_MouseEnter(object sender, EventArgs e)
- {
- this.Cursor = System.Windows.Forms.Cursors.Hand;
- }
- private void toolStripStatusLabel3_Click(object sender, EventArgs e)
- {
- if (on == true)
- {
- toolStripStatusLabel3.Text = "Enable binds";
- on = false;
- }
- else
- {
- toolStripStatusLabel3.Text = "Disable binds";
- on = true;
- }
- }
- private void textjos_MouseLeave(object sender, EventArgs e)
- {
- this.Cursor = System.Windows.Forms.Cursors.Default;
- }
- private void textjos2_MouseEnter(object sender, EventArgs e)
- {
- this.Cursor = System.Windows.Forms.Cursors.Hand;
- }
- private void textjos2_MouseLeave(object sender, EventArgs e)
- {
- this.Cursor = System.Windows.Forms.Cursors.Default;
- }
- private void toolStripStatusLabel3_MouseEnter(object sender, EventArgs e)
- {
- this.Cursor = System.Windows.Forms.Cursors.Hand;
- }
- private void toolStripStatusLabel3_MouseLeave(object sender, EventArgs e)
- {
- this.Cursor = System.Windows.Forms.Cursors.Default;
- }
- #endregion
- #region functii smooth / rapid
- private void directlyToolStripMenuItem_Click(object sender, EventArgs e)
- {
- smoth = false;
- Properties.Settings.Default.smoth = false;
- Properties.Settings.Default.Save();
- smoothToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Unchecked ;
- directlyToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked;
- }
- private void smoothToolStripMenuItem_Click(object sender, EventArgs e)
- {
- smoth = true;
- Properties.Settings.Default.smoth = true;
- Properties.Settings.Default.Save();
- directlyToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Unchecked;
- smoothToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked;
- }
- #endregion
- #region salvare
- #region salvare taste
- private void textBox30_KeyDown(object sender, KeyEventArgs e)
- {
- if (e.KeyValue != 13 && e.KeyValue != 16 && e.KeyValue != 17 && e.KeyValue != 18 && e.KeyValue != 27)
- {
- hk1.Text = e.KeyData.ToString() + "(" + e.KeyValue + ")";
- Properties.Settings.Default.tasta1 = e.KeyValue;
- if (e.KeyValue == 46)
- {
- Properties.Settings.Default.tasta1 = 0;
- hk1.Text = "None(0)";
- }
- Properties.Settings.Default.Save();
- }
- }
- private void textBox40_KeyDown(object sender, KeyEventArgs e)
- {
- if (e.KeyValue != 13 && e.KeyValue != 16 && e.KeyValue != 17 && e.KeyValue != 18 && e.KeyValue != 27)
- {
- hk2.Text = e.KeyData.ToString() + "(" + e.KeyValue + ")";
- Properties.Settings.Default.tasta2 = e.KeyValue;
- if (e.KeyValue == 46)
- {
- Properties.Settings.Default.tasta2 = 0; hk2.Text = "None(0)";
- }
- Properties.Settings.Default.Save();
- }
- }
- private void textBox29_KeyDown(object sender, KeyEventArgs e)
- {
- if (e.KeyValue != 13 && e.KeyValue != 16 && e.KeyValue != 17 && e.KeyValue != 18 && e.KeyValue != 27)
- {
- hk3.Text = e.KeyData.ToString() + "(" + e.KeyValue + ")";
- Properties.Settings.Default.tasta3 = e.KeyValue;
- if (e.KeyValue == 46)
- {
- Properties.Settings.Default.tasta3 = 0;
- hk3.Text = "None(0)";
- } Properties.Settings.Default.Save();
- }
- }
- private void textBox39_KeyDown(object sender, KeyEventArgs e)
- {
- if (e.KeyValue != 13 && e.KeyValue != 16 && e.KeyValue != 17 && e.KeyValue != 18 && e.KeyValue != 27)
- {
- hk4.Text = e.KeyData.ToString() + "(" + e.KeyValue + ")";
- Properties.Settings.Default.tasta4 = e.KeyValue;
- if (e.KeyValue == 46)
- {
- Properties.Settings.Default.tasta4 = 0;
- hk4.Text = "None(0)";
- }
- Properties.Settings.Default.Save();
- }
- }
- private void textBox28_KeyDown(object sender, KeyEventArgs e)
- {
- if (e.KeyValue != 13 && e.KeyValue != 16 && e.KeyValue != 17 && e.KeyValue != 18 && e.KeyValue != 27)
- {
- hk5.Text = e.KeyData.ToString() + "(" + e.KeyValue + ")";
- Properties.Settings.Default.tasta5 = e.KeyValue;
- if (e.KeyValue == 46)
- {
- Properties.Settings.Default.tasta5 = 0;
- hk5.Text = "None(0)";
- }
- Properties.Settings.Default.Save();
- }
- }
- private void textBox38_KeyDown(object sender, KeyEventArgs e)
- {
- if (e.KeyValue != 13 && e.KeyValue != 16 && e.KeyValue != 17 && e.KeyValue != 18 && e.KeyValue != 27)
- {
- hk6.Text = e.KeyData.ToString() + "(" + e.KeyValue + ")";
- Properties.Settings.Default.tasta6 = e.KeyValue;
- if (e.KeyValue == 46) { Properties.Settings.Default.tasta6 = 0; hk6.Text = "None(0)"; }
- Properties.Settings.Default.Save();
- }
- }
- private void textBox27_KeyDown(object sender, KeyEventArgs e)
- {
- if (e.KeyValue != 13 && e.KeyValue != 16 && e.KeyValue != 17 && e.KeyValue != 18 && e.KeyValue != 27)
- {
- hk7.Text = e.KeyData.ToString() + "(" + e.KeyValue + ")";
- Properties.Settings.Default.tasta7 = e.KeyValue;
- if (e.KeyValue == 46) { Properties.Settings.Default.tasta7 = 0; hk7.Text = "None(0)"; } Properties.Settings.Default.Save();
- }
- }
- private void textBox37_KeyDown(object sender, KeyEventArgs e)
- {
- if (e.KeyValue != 13 && e.KeyValue != 16 && e.KeyValue != 17 && e.KeyValue != 18 && e.KeyValue != 27)
- {
- hk8.Text = e.KeyData.ToString() + "(" + e.KeyValue + ")";
- Properties.Settings.Default.tasta8 = e.KeyValue;
- if (e.KeyValue == 46) { Properties.Settings.Default.tasta8 = 0; hk8.Text = "None(0)"; } Properties.Settings.Default.Save();
- }
- }
- private void textBox26_KeyDown(object sender, KeyEventArgs e)
- {
- if (e.KeyValue != 13 && e.KeyValue != 16 && e.KeyValue != 17 && e.KeyValue != 18 && e.KeyValue != 27)
- {
- hk9.Text = e.KeyData.ToString() + "(" + e.KeyValue + ")";
- Properties.Settings.Default.tasta9 = e.KeyValue;
- if (e.KeyValue == 46) { Properties.Settings.Default.tasta9 = 0; hk9.Text = "None(0)"; } Properties.Settings.Default.Save();
- }
- }
- private void textBox36_KeyDown(object sender, KeyEventArgs e)
- {
- if (e.KeyValue != 13 && e.KeyValue != 16 && e.KeyValue != 17 && e.KeyValue != 18 && e.KeyValue != 27)
- {
- hk10.Text = e.KeyData.ToString() + "(" + e.KeyValue + ")";
- Properties.Settings.Default.tasta10 = e.KeyValue;
- if (e.KeyValue == 46) { Properties.Settings.Default.tasta10 = 0; hk10.Text = "None(0)"; } Properties.Settings.Default.Save();
- }
- }
- private void textBox25_KeyDown(object sender, KeyEventArgs e)
- {
- if (e.KeyValue != 13 && e.KeyValue != 16 && e.KeyValue != 17 && e.KeyValue != 18 && e.KeyValue != 27)
- {
- hk11.Text = e.KeyData.ToString() + "(" + e.KeyValue + ")";
- Properties.Settings.Default.tasta11 = e.KeyValue;
- if (e.KeyValue == 46) { Properties.Settings.Default.tasta11 = 0; hk11.Text = "None(0)"; } Properties.Settings.Default.Save();
- }
- }
- private void textBox35_KeyDown(object sender, KeyEventArgs e)
- {
- if (e.KeyValue != 13 && e.KeyValue != 16 && e.KeyValue != 17 && e.KeyValue != 18 && e.KeyValue != 27)
- {
- hk12.Text = e.KeyData.ToString() + "(" + e.KeyValue + ")";
- Properties.Settings.Default.tasta12 = e.KeyValue;
- if (e.KeyValue == 46) { Properties.Settings.Default.tasta12 = 0; hk12.Text = "None(0)"; } Properties.Settings.Default.Save();
- }
- }
- private void textBox24_KeyDown(object sender, KeyEventArgs e)
- {
- if (e.KeyValue != 13 && e.KeyValue != 16 && e.KeyValue != 17 && e.KeyValue != 18 && e.KeyValue != 27)
- {
- hk13.Text = e.KeyData.ToString() + "(" + e.KeyValue + ")";
- Properties.Settings.Default.tasta13 = e.KeyValue;
- if (e.KeyValue == 46) { Properties.Settings.Default.tasta13 = 0; hk13.Text = "None(0)"; } Properties.Settings.Default.Save();
- }
- }
- private void textBox34_KeyDown(object sender, KeyEventArgs e)
- {
- if (e.KeyValue != 13 && e.KeyValue != 16 && e.KeyValue != 17 && e.KeyValue != 18 && e.KeyValue != 27)
- {
- hk14.Text = e.KeyData.ToString() + "(" + e.KeyValue + ")";
- Properties.Settings.Default.tasta14 = e.KeyValue;
- if (e.KeyValue == 46) { Properties.Settings.Default.tasta14 = 0; hk14.Text = "None(0)"; } Properties.Settings.Default.Save();
- }
- }
- private void textBox23_KeyDown(object sender, KeyEventArgs e)
- {
- if (e.KeyValue != 13 && e.KeyValue != 16 && e.KeyValue != 17 && e.KeyValue != 18 && e.KeyValue != 27)
- {
- hk15.Text = e.KeyData.ToString() + "(" + e.KeyValue + ")";
- Properties.Settings.Default.tasta15 = e.KeyValue;
- if (e.KeyValue == 46) { Properties.Settings.Default.tasta15 = 0; hk15.Text = "None(0)"; } Properties.Settings.Default.Save();
- }
- }
- private void textBox33_KeyDown(object sender, KeyEventArgs e)
- {
- if (e.KeyValue != 13 && e.KeyValue != 16 && e.KeyValue != 17 && e.KeyValue != 18 && e.KeyValue != 27)
- {
- hk16.Text = e.KeyData.ToString() + "(" + e.KeyValue + ")";
- Properties.Settings.Default.tasta16 = e.KeyValue;
- if (e.KeyValue == 46) { hk16.Text = "None(0)"; Properties.Settings.Default.tasta16 = 0; } Properties.Settings.Default.Save();
- }
- }
- private void textBox22_KeyDown(object sender, KeyEventArgs e)
- {
- if (e.KeyValue != 13 && e.KeyValue != 16 && e.KeyValue != 17 && e.KeyValue != 18 && e.KeyValue != 27)
- {
- hk17.Text = e.KeyData.ToString() + "(" + e.KeyValue + ")";
- Properties.Settings.Default.tasta17 = e.KeyValue;
- if (e.KeyValue == 46) { hk17.Text = "None(0)"; Properties.Settings.Default.tasta17 = 0; } Properties.Settings.Default.Save();
- }
- }
- private void textBox32_KeyDown(object sender, KeyEventArgs e)
- {
- if (e.KeyValue != 13 && e.KeyValue != 16 && e.KeyValue != 17 && e.KeyValue != 18 && e.KeyValue != 27)
- {
- hk18.Text = e.KeyData.ToString() + "(" + e.KeyValue + ")";
- Properties.Settings.Default.tasta18 = e.KeyValue;
- if (e.KeyValue == 46) { hk18.Text = "None(0)"; Properties.Settings.Default.tasta18 = 0; } Properties.Settings.Default.Save();
- }
- }
- private void textBox21_KeyDown(object sender, KeyEventArgs e)
- {
- if (e.KeyValue != 13 && e.KeyValue != 16 && e.KeyValue != 17 && e.KeyValue != 18 && e.KeyValue != 27)
- {
- hk19.Text = e.KeyData.ToString() + "(" + e.KeyValue + ")";
- Properties.Settings.Default.tasta19 = e.KeyValue;
- if (e.KeyValue == 46) { hk19.Text = "None(0)"; Properties.Settings.Default.tasta19 = 0; } Properties.Settings.Default.Save();
- }
- }
- private void textBox31_KeyDown(object sender, KeyEventArgs e)
- {
- if (e.KeyValue != 13 && e.KeyValue != 16 && e.KeyValue != 17 && e.KeyValue != 18 && e.KeyValue != 27)
- {
- hk20.Text = e.KeyData.ToString() + "(" + e.KeyValue + ")";
- Properties.Settings.Default.tasta20 = e.KeyValue;
- if (e.KeyValue == 46) { hk20.Text = "None(0)"; Properties.Settings.Default.tasta20 = 0; } Properties.Settings.Default.Save();
- }
- }
- #endregion
- #region salvare text
- private void textBox1_TextChanged(object sender, EventArgs e)
- {
- Properties.Settings.Default.text1 = text1.Text;
- Properties.Settings.Default.Save();
- }
- private void textBox11_TextChanged(object sender, EventArgs e)
- {
- Properties.Settings.Default.text2 = text2.Text;
- Properties.Settings.Default.Save();
- }
- private void textBox2_TextChanged(object sender, EventArgs e)
- {
- Properties.Settings.Default.text3 = text3.Text;
- Properties.Settings.Default.Save();
- }
- private void textBox12_TextChanged(object sender, EventArgs e)
- {
- Properties.Settings.Default.text4 = text4.Text;
- Properties.Settings.Default.Save();
- }
- private void textBox3_TextChanged(object sender, EventArgs e)
- {
- Properties.Settings.Default.text5 = text5.Text;
- Properties.Settings.Default.Save();
- }
- private void textBox13_TextChanged(object sender, EventArgs e)
- {
- Properties.Settings.Default.text6 = text6.Text;
- Properties.Settings.Default.Save();
- }
- private void textBox4_TextChanged(object sender, EventArgs e)
- {
- Properties.Settings.Default.text7 = text7.Text;
- Properties.Settings.Default.Save();
- }
- private void textBox14_TextChanged(object sender, EventArgs e)
- {
- Properties.Settings.Default.text8 = text8.Text;
- Properties.Settings.Default.Save();
- }
- private void textBox5_TextChanged(object sender, EventArgs e)
- {
- Properties.Settings.Default.text9 = text9.Text;
- Properties.Settings.Default.Save();
- }
- private void textBox15_TextChanged(object sender, EventArgs e)
- {
- Properties.Settings.Default.text10 = text10.Text;
- Properties.Settings.Default.Save();
- }
- private void textBox6_TextChanged(object sender, EventArgs e)
- {
- Properties.Settings.Default.text11 = text11.Text;
- Properties.Settings.Default.Save();
- }
- private void textBox16_TextChanged(object sender, EventArgs e)
- {
- Properties.Settings.Default.text12 = text12.Text;
- Properties.Settings.Default.Save();
- }
- private void textBox7_TextChanged(object sender, EventArgs e)
- {
- Properties.Settings.Default.text13 = text13.Text;
- Properties.Settings.Default.Save();
- }
- private void textBox17_TextChanged(object sender, EventArgs e)
- {
- Properties.Settings.Default.text14 = text14.Text;
- Properties.Settings.Default.Save();
- }
- private void textBox8_TextChanged(object sender, EventArgs e)
- {
- Properties.Settings.Default.text15 = text15.Text;
- Properties.Settings.Default.Save();
- }
- private void textBox18_TextChanged(object sender, EventArgs e)
- {
- Properties.Settings.Default.text16= text16.Text;
- Properties.Settings.Default.Save();
- }
- private void textBox9_TextChanged(object sender, EventArgs e)
- {
- Properties.Settings.Default.text17 = text17.Text;
- Properties.Settings.Default.Save();
- }
- private void textBox19_TextChanged(object sender, EventArgs e)
- {
- Properties.Settings.Default.text18 = text18.Text;
- Properties.Settings.Default.Save();
- }
- private void textBox10_TextChanged(object sender, EventArgs e)
- {
- Properties.Settings.Default.text19 = text19.Text;
- Properties.Settings.Default.Save();
- }
- private void textBox20_TextChanged(object sender, EventArgs e)
- {
- Properties.Settings.Default.text20 = text20.Text;
- Properties.Settings.Default.Save();
- }
- #endregion
- #endregion
- #region functii gta/anywin
- private void anyWindowToolStripMenuItem_Click(object sender, EventArgs e)
- {
- doar_gta = true;
- Properties.Settings.Default.doargta = true;
- Properties.Settings.Default.Save();
- justgta.CheckState = System.Windows.Forms.CheckState.Checked;
- anywin.CheckState = System.Windows.Forms.CheckState.Unchecked;
- }
- private void anyWindowToolStripMenuItem1_Click(object sender, EventArgs e)
- {
- doar_gta = false;
- Properties.Settings.Default.doargta = false;
- Properties.Settings.Default.Save();
- anywin.CheckState = System.Windows.Forms.CheckState.Checked;
- justgta.CheckState = System.Windows.Forms.CheckState.Unchecked;
- }
- #endregion
- private void update_Tick(object sender, EventArgs e)
- {
- #region Chat Deschis / Inchis
- IntPtr a = GetForegroundWindow();
- IntPtr b = FindWindow(null, "GTA:SA:MP");
- if (a == b)
- {
- if (TT == false)
- if (pressed(Keys.T))
- {
- TT = true;
- }
- if (TT)
- if (!pressed(Keys.T))
- {
- TT = false; chat_inchis = false;
- }
- if (tastaESC == false)
- if (pressed(Keys.Escape))
- {
- tastaESC = true;
- }
- if (tastaESC)
- if (!pressed(Keys.Escape))
- {
- tastaESC = false; chat_inchis = true;
- }
- if (tastaENTER == false)
- if (pressed(Keys.Return))
- {
- tastaENTER = true;
- }
- if (tastaENTER)
- if (!pressed(Keys.Return))
- {
- tastaENTER = false; chat_inchis = true;
- }
- }
- else
- chat_inchis = true;
- #endregion
- #region regkeys
- regkeys(1, Properties.Settings.Default.tasta1, bind1);
- regkeys(2, Properties.Settings.Default.tasta2, bind2);
- regkeys(3, Properties.Settings.Default.tasta3, bind3);
- regkeys(4, Properties.Settings.Default.tasta4, bind4);
- regkeys(5, Properties.Settings.Default.tasta5, bind5);
- regkeys(6, Properties.Settings.Default.tasta6, bind6);
- regkeys(7, Properties.Settings.Default.tasta7, bind7);
- regkeys(8, Properties.Settings.Default.tasta8, bind8);
- regkeys(9, Properties.Settings.Default.tasta9, bind9);
- regkeys(10, Properties.Settings.Default.tasta10, bind10);
- regkeys(11, Properties.Settings.Default.tasta11, bind11);
- regkeys(12, Properties.Settings.Default.tasta12, bind12);
- regkeys(13, Properties.Settings.Default.tasta13, bind13);
- regkeys(14, Properties.Settings.Default.tasta14, bind14);
- regkeys(15, Properties.Settings.Default.tasta15, bind15);
- regkeys(16, Properties.Settings.Default.tasta16, bind16);
- regkeys(17, Properties.Settings.Default.tasta17, bind17);
- regkeys(18, Properties.Settings.Default.tasta18, bind18);
- regkeys(19, Properties.Settings.Default.tasta19, bind19);
- regkeys(20, Properties.Settings.Default.tasta20, bind20);
- #endregion
- #region true /false
- if (Properties.Settings.Default.tasta1 != 0)
- bind1 = true;
- else bind1 = false;
- if (Properties.Settings.Default.tasta2 != 0)
- bind2 = true;
- else bind2 = false;
- if (Properties.Settings.Default.tasta3 != 0 && ind>=2)
- bind3 = true;
- else bind3 = false;
- if (Properties.Settings.Default.tasta4 != 0 && ind >= 2)
- bind4 = true;
- else bind4 = false;
- if (Properties.Settings.Default.tasta5 != 0 && ind >= 3)
- bind5 = true;
- else bind5 = false;
- if (Properties.Settings.Default.tasta6 != 0 && ind >= 3)
- bind6 = true;
- else bind6 = false;
- if (Properties.Settings.Default.tasta7 != 0 && ind >= 4)
- bind7 = true;
- else bind7 = false;
- if (Properties.Settings.Default.tasta8 != 0 && ind >= 4)
- bind8 = true;
- else bind8 = false;
- if (Properties.Settings.Default.tasta9 != 0 && ind >= 5)
- bind9 = true;
- else bind9 = false;
- if (Properties.Settings.Default.tasta10 != 0 && ind >= 5)
- bind10 = true;
- else bind10 = false;
- if (Properties.Settings.Default.tasta11 != 0 && ind >= 6)
- bind11 = true;
- else bind11 = false;
- if (Properties.Settings.Default.tasta12 != 0 && ind >= 6)
- bind12 = true;
- else bind12 = false;
- if (Properties.Settings.Default.tasta13 != 0 && ind >= 7)
- bind13 = true;
- else bind13 = false;
- if (Properties.Settings.Default.tasta14 != 0 && ind >= 7)
- bind14 = true;
- else bind14 = false;
- if (Properties.Settings.Default.tasta15 != 0 && ind >= 8)
- bind15 = true;
- else bind15 = false;
- if (Properties.Settings.Default.tasta16 != 0 && ind >= 8)
- bind16 = true;
- else bind16 = false;
- if (Properties.Settings.Default.tasta17 != 0 && ind >= 9)
- bind17 = true;
- else bind17 = false;
- if (Properties.Settings.Default.tasta18 != 0 && ind >= 9)
- bind18 = true;
- else bind18 = false;
- if (Properties.Settings.Default.tasta19 != 0 && ind >= 10)
- bind19 = true;
- else bind19 = false;
- if (Properties.Settings.Default.tasta20 != 0 && ind >= 10)
- bind20 = true;
- else bind20 = false;
- #endregion
- #region old,useless
- /*
- bool ok = false;
- IntPtr a = GetForegroundWindow();
- IntPtr b = FindWindow(null, "Untitled - Notepad");
- if (a == b)
- ok = true;
- if(doar_gta)
- if (bind1 && ok)
- {
- RegisterHotKey(this.Handle, 1, nimic, (uint)((Keys)Properties.Settings.Default.tasta1));
- }
- else
- UnregisterHotKey(this.Handle, 1);
- else
- if (bind1)
- {
- RegisterHotKey(this.Handle, 1, nimic, (uint)((Keys)Properties.Settings.Default.tasta1));
- }
- else
- UnregisterHotKey(this.Handle, 1);
- * */
- #endregion
- }
- protected override void WndProc(ref Message m)
- {
- base.WndProc(ref m);
- if (m.Msg == WM_HOTKEY)
- {
- switch ((short)m.WParam)
- {
- #region cazurile (20, 20 textbox-uri)
- case 1: caz(text1.Text); break;
- case 2: caz(text2.Text); break;
- case 3: caz(text3.Text); break;
- case 4: caz(text4.Text); break;
- case 5: caz(text5.Text); break;
- case 6: caz(text6.Text); break;
- case 7: caz(text7.Text); break;
- case 8: caz(text8.Text); break;
- case 9: caz(text9.Text); break;
- case 10: caz(text10.Text); break;
- case 11: caz(text11.Text); break;
- case 12: caz(text12.Text); break;
- case 13: caz(text13.Text); break;
- case 14: caz(text14.Text); break;
- case 15: caz(text15.Text); break;
- case 16: caz(text16.Text); break;
- case 17: caz(text17.Text); break;
- case 18: caz(text18.Text); break;
- case 19: caz(text19.Text); break;
- case 20: caz(text20.Text); break;
- #endregion
- }
- }
- }
- #region file
- private void saveCurentBindsToolStripMenuItem_Click(object sender, EventArgs e)
- {
- string t = "";
- string s = Environment.NewLine;
- t += text1.Text + s;
- t += Properties.Settings.Default.tasta1.ToString()+s;
- t += text2.Text + s;
- t += Properties.Settings.Default.tasta2.ToString() + s;
- t += text3.Text + s;
- t += Properties.Settings.Default.tasta3.ToString() + s;
- t += text4.Text + s;
- t += Properties.Settings.Default.tasta4.ToString() + s;
- t += text5.Text + s;
- t += Properties.Settings.Default.tasta5.ToString() + s;
- t += text6.Text + s;
- t += Properties.Settings.Default.tasta6.ToString() + s;
- t += text7.Text + s;
- t += Properties.Settings.Default.tasta7.ToString() + s;
- t += text8.Text + s;
- t += Properties.Settings.Default.tasta8.ToString() + s;
- t += text9.Text + s;
- t += Properties.Settings.Default.tasta9.ToString() + s;
- t += text10.Text + s;
- t += Properties.Settings.Default.tasta10.ToString() + s;
- t += text11.Text + s;
- t += Properties.Settings.Default.tasta11.ToString() + s;
- t += text12.Text + s;
- t += Properties.Settings.Default.tasta12.ToString() + s;
- t += text13.Text + s;
- t += Properties.Settings.Default.tasta13.ToString() + s;
- t += text14.Text + s;
- t += Properties.Settings.Default.tasta14.ToString() + s;
- t += text15.Text + s;
- t += Properties.Settings.Default.tasta15.ToString() + s;
- t += text16.Text + s;
- t += Properties.Settings.Default.tasta16.ToString() + s;
- t += text17.Text + s;
- t += Properties.Settings.Default.tasta17.ToString() + s;
- t += text18.Text + s;
- t += Properties.Settings.Default.tasta18.ToString() + s;
- t += text19.Text + s;
- t += Properties.Settings.Default.tasta19.ToString() + s;
- t += text20.Text + s;
- t += Properties.Settings.Default.tasta20.ToString() + s;
- save.ShowDialog();
- try
- {
- if (save.FileName != "")
- {
- StreamWriter sr = new StreamWriter(save.FileName);
- sr.Write(t);
- sr.Close();
- }
- }
- catch (Exception ex)
- {
- MessageBox.Show("We couldn't save the binds", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
- }
- }
- private void exitToolStripMenuItem_Click(object sender, EventArgs e)
- {
- this.Close();
- }
- private void openSavedBindsToolStripMenuItem_Click(object sender, EventArgs e)
- {
- open.ShowDialog();
- }
- #endregion
- private void label1_Click(object sender, EventArgs e)
- {
- }
- private void label2_Click(object sender, EventArgs e)
- {
- }
- private void label4_Click(object sender, EventArgs e)
- {
- }
- private void label3_Click(object sender, EventArgs e)
- {
- }
- #region t enter
- private void label5_Click(object sender, EventArgs e)
- {
- if (!text1.Text.ToUpper().Contains("{ENTER}"))
- text1.Text += "{ENTER}";
- if (text1.Text != "")
- if (text1.Text[0].ToString() != "t")
- text1.Text = "t"+text1.Text;
- }
- private void label6_Click(object sender, EventArgs e)
- {
- if (!text3.Text.ToUpper().Contains("{ENTER}"))
- text3.Text += "{ENTER}";
- if (text3.Text != "")
- if (text3.Text[0].ToString() != "t")
- text3.Text = "t" + text3.Text;
- }
- private void label8_Click(object sender, EventArgs e)
- {
- if (!text5.Text.ToUpper().Contains("{ENTER}"))
- text5.Text += "{ENTER}";
- if (text5.Text != "")
- if (text5.Text[0].ToString() != "t")
- text5.Text = "t" + text5.Text;
- }
- private void label7_Click(object sender, EventArgs e)
- {
- if (!text7.Text.ToUpper().Contains("{ENTER}"))
- text7.Text += "{ENTER}";
- if (text7.Text != "")
- if (text7.Text[0].ToString() != "t")
- text7.Text = "t" + text7.Text;
- }
- private void label12_Click(object sender, EventArgs e)
- {
- if (!text9.Text.ToUpper().Contains("{ENTER}"))
- text9.Text += "{ENTER}";
- if (text9.Text != "")
- if (text9.Text[0].ToString() != "t")
- text9.Text = "t" + text9.Text;
- }
- private void label11_Click(object sender, EventArgs e)
- {
- if (!text11.Text.ToUpper().Contains("{ENTER}"))
- text11.Text += "{ENTER}";
- if (text11.Text != "")
- if (text11.Text[0].ToString() != "t")
- text11.Text = "t" + text11.Text;
- }
- private void label10_Click(object sender, EventArgs e)
- {
- if (!text13.Text.ToUpper().Contains("{ENTER}"))
- text13.Text += "{ENTER}";
- if (text13.Text != "")
- if (text13.Text[0].ToString() != "t")
- text13.Text = "t" + text13.Text;
- }
- private void label9_Click(object sender, EventArgs e)
- {
- if (!text15.Text.ToUpper().Contains("{ENTER}"))
- text15.Text += "{ENTER}";
- if (text15.Text != "")
- if (text15.Text[0].ToString() != "t")
- text15.Text = "t" + text15.Text;
- }
- private void label14_Click(object sender, EventArgs e)
- {
- if (!text17.Text.ToUpper().Contains("{ENTER}"))
- text17.Text += "{ENTER}";
- if (text17.Text != "")
- if (text17.Text[0].ToString() != "t")
- text17.Text = "t" + text17.Text;
- }
- private void label13_Click(object sender, EventArgs e)
- {
- if (!text19.Text.ToUpper().Contains("{ENTER}"))
- text19.Text += "{ENTER}";
- if (text19.Text != "")
- if (text19.Text[0].ToString() != "t")
- text19.Text = "t" + text19.Text;
- }
- private void label24_Click(object sender, EventArgs e)
- {
- if (!text2.Text.ToUpper().Contains("{ENTER}"))
- text2.Text += "{ENTER}";
- if (text2.Text != "")
- if (text2.Text[0].ToString() != "t")
- text2.Text = "t" + text2.Text;
- }
- private void label23_Click(object sender, EventArgs e)
- {
- if (!text4.Text.ToUpper().Contains("{ENTER}"))
- text4.Text += "{ENTER}";
- if (text4.Text != "")
- if (text4.Text[0].ToString() != "t")
- text4.Text = "t" + text4.Text;
- }
- private void label22_Click(object sender, EventArgs e)
- {
- if (!text6.Text.ToUpper().Contains("{ENTER}"))
- text6.Text += "{ENTER}";
- if (text6.Text != "")
- if (text6.Text[0].ToString() != "t")
- text6.Text = "t" + text6.Text;
- }
- private void label21_Click(object sender, EventArgs e)
- {
- if (!text8.Text.ToUpper().Contains("{ENTER}"))
- text8.Text += "{ENTER}";
- if (text8.Text != "")
- if (text8.Text[0].ToString() != "t")
- text8.Text = "t" + text8.Text;
- }
- private void label20_Click(object sender, EventArgs e)
- {
- if (!text10.Text.ToUpper().Contains("{ENTER}"))
- text10.Text += "{ENTER}";
- if (text10.Text != "")
- if (text10.Text[0].ToString() != "t")
- text10.Text = "t" + text10.Text;
- }
- private void label19_Click(object sender, EventArgs e)
- {
- if (!text12.Text.ToUpper().Contains("{ENTER}"))
- text12.Text += "{ENTER}";
- if (text12.Text != "")
- if (text12.Text[0].ToString() != "t")
- text12.Text = "t" + text12.Text;
- }
- private void label18_Click(object sender, EventArgs e)
- {
- if (!text14.Text.ToUpper().Contains("{ENTER}"))
- text14.Text += "{ENTER}";
- if (text14.Text != "")
- if (text14.Text[0].ToString() != "t")
- text14.Text = "t" + text14.Text;
- }
- private void label17_Click(object sender, EventArgs e)
- {
- if (!text16.Text.ToUpper().Contains("{ENTER}"))
- text16.Text += "{ENTER}";
- if (text16.Text != "")
- if (text16.Text[0].ToString() != "t")
- text16.Text = "t" + text16.Text;
- }
- private void label16_Click(object sender, EventArgs e)
- {
- if (!text18.Text.ToUpper().Contains("{ENTER}"))
- text18.Text += "{ENTER}";
- if (text18.Text != "")
- if (text18.Text[0].ToString() != "t")
- text18.Text = "t" + text18.Text;
- }
- private void label15_Click(object sender, EventArgs e)
- {
- if (!text20.Text.ToUpper().Contains("{ENTER}"))
- text20.Text += "{ENTER}";
- if (text20.Text != "")
- if (text20.Text[0].ToString() != "t")
- text20.Text = "t" + text20.Text;
- }
- #endregion
- private void save_FileOk(object sender, CancelEventArgs e)
- {
- }
- private void open_FileOk(object sender, CancelEventArgs e)
- {
- try
- {
- int i;
- string ii;
- StreamReader sr = new StreamReader(open.FileName);
- text1.Text = sr.ReadLine();
- i = Convert.ToInt32(sr.ReadLine());
- ii = ((Keys)i).ToString();
- hk1.Text = ii + "(" + i + ")";
- Properties.Settings.Default.tasta1 = i;
- Properties.Settings.Default.Save();
- text2.Text = sr.ReadLine();
- i = Convert.ToInt32(sr.ReadLine());
- ii = ((Keys)i).ToString();
- hk2.Text = ii + "(" + i + ")";
- Properties.Settings.Default.tasta2 = i;
- Properties.Settings.Default.Save();
- text3.Text = sr.ReadLine();
- i = Convert.ToInt32(sr.ReadLine());
- ii = ((Keys)i).ToString();
- hk3.Text = ii + "(" + i + ")";
- Properties.Settings.Default.tasta3 = i;
- Properties.Settings.Default.Save();
- text4.Text = sr.ReadLine();
- i = Convert.ToInt32(sr.ReadLine());
- ii = ((Keys)i).ToString();
- hk4.Text = ii + "(" + i + ")";
- Properties.Settings.Default.tasta4 = i;
- Properties.Settings.Default.Save();
- text5.Text = sr.ReadLine();
- i = Convert.ToInt32(sr.ReadLine());
- ii = ((Keys)i).ToString();
- hk5.Text = ii + "(" + i + ")";
- Properties.Settings.Default.tasta5 = i;
- Properties.Settings.Default.Save();
- text6.Text = sr.ReadLine();
- i = Convert.ToInt32(sr.ReadLine());
- ii = ((Keys)i).ToString();
- hk6.Text = ii + "(" + i + ")";
- Properties.Settings.Default.tasta6 = i;
- Properties.Settings.Default.Save();
- text7.Text = sr.ReadLine();
- i = Convert.ToInt32(sr.ReadLine());
- ii = ((Keys)i).ToString();
- hk7.Text = ii + "(" + i + ")";
- Properties.Settings.Default.tasta7 = i;
- Properties.Settings.Default.Save();
- text8.Text = sr.ReadLine();
- i = Convert.ToInt32(sr.ReadLine());
- ii = ((Keys)i).ToString();
- hk8.Text = ii + "(" + i + ")";
- Properties.Settings.Default.tasta8 = i;
- Properties.Settings.Default.Save();
- text9.Text = sr.ReadLine();
- i = Convert.ToInt32(sr.ReadLine());
- ii = ((Keys)i).ToString();
- hk9.Text = ii + "(" + i + ")";
- Properties.Settings.Default.tasta9 = i;
- Properties.Settings.Default.Save();
- text10.Text = sr.ReadLine();
- i = Convert.ToInt32(sr.ReadLine());
- ii = ((Keys)i).ToString();
- hk10.Text = ii + "(" + i + ")";
- Properties.Settings.Default.tasta10 = i;
- Properties.Settings.Default.Save();
- text11.Text = sr.ReadLine();
- i = Convert.ToInt32(sr.ReadLine());
- ii = ((Keys)i).ToString();
- hk11.Text = ii + "(" + i + ")";
- Properties.Settings.Default.tasta11 = i;
- Properties.Settings.Default.Save();
- text12.Text = sr.ReadLine();
- i = Convert.ToInt32(sr.ReadLine());
- ii = ((Keys)i).ToString();
- hk12.Text = ii + "(" + i + ")";
- Properties.Settings.Default.tasta12 = i;
- Properties.Settings.Default.Save();
- text13.Text = sr.ReadLine();
- i = Convert.ToInt32(sr.ReadLine());
- ii = ((Keys)i).ToString();
- hk13.Text = ii + "(" + i + ")";
- Properties.Settings.Default.tasta13 = i;
- Properties.Settings.Default.Save();
- text14.Text = sr.ReadLine();
- i = Convert.ToInt32(sr.ReadLine());
- ii = ((Keys)i).ToString();
- hk14.Text = ii + "(" + i + ")";
- Properties.Settings.Default.tasta14 = i;
- Properties.Settings.Default.Save();
- text15.Text = sr.ReadLine();
- i = Convert.ToInt32(sr.ReadLine());
- ii = ((Keys)i).ToString();
- hk15.Text = ii + "(" + i + ")";
- Properties.Settings.Default.tasta15 = i;
- Properties.Settings.Default.Save();
- text16.Text = sr.ReadLine();
- i = Convert.ToInt32(sr.ReadLine());
- ii = ((Keys)i).ToString();
- hk16.Text = ii + "(" + i + ")";
- Properties.Settings.Default.tasta16 = i;
- Properties.Settings.Default.Save();
- text17.Text = sr.ReadLine();
- i = Convert.ToInt32(sr.ReadLine());
- ii = ((Keys)i).ToString();
- hk17.Text = ii + "(" + i + ")";
- Properties.Settings.Default.tasta17 = i;
- Properties.Settings.Default.Save();
- text18.Text = sr.ReadLine();
- i = Convert.ToInt32(sr.ReadLine());
- ii = ((Keys)i).ToString();
- hk18.Text = ii + "(" + i + ")";
- Properties.Settings.Default.tasta18 = i;
- Properties.Settings.Default.Save();
- text19.Text = sr.ReadLine();
- i = Convert.ToInt32(sr.ReadLine());
- ii = ((Keys)i).ToString();
- hk19.Text = ii + "(" + i + ")";
- Properties.Settings.Default.tasta19 = i;
- Properties.Settings.Default.Save();
- text20.Text = sr.ReadLine();
- i = Convert.ToInt32(sr.ReadLine());
- ii = ((Keys)i).ToString();
- hk20.Text = ii + "(" + i + ")";
- Properties.Settings.Default.tasta20 = i;
- Properties.Settings.Default.Save();
- }
- catch (Exception ex)
- {
- MessageBox.Show("We couldn't open the binds", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
- }
- }
- bool enab = true;
- private void toolStripStatusLabel5_Click(object sender, EventArgs e)
- {
- if (enab)
- {
- Properties.Settings.Default.enab = false;
- Properties.Settings.Default.Save();
- toolStripStatusLabel5.Text = "Disable Read Only";
- hk1.Enabled = false;
- hk2.Enabled = false;
- hk3.Enabled = false;
- hk4.Enabled = false;
- hk5.Enabled = false;
- hk6.Enabled = false;
- hk7.Enabled = false;
- hk8.Enabled = false;
- hk9.Enabled = false;
- hk10.Enabled = false;
- hk11.Enabled = false;
- hk12.Enabled = false;
- hk13.Enabled = false;
- hk14.Enabled = false;
- hk15.Enabled = false;
- hk16.Enabled = false;
- hk17.Enabled = false;
- hk18.Enabled = false;
- hk19.Enabled = false;
- hk20.Enabled = false;
- text1.Enabled = false;
- text2.Enabled = false;
- text3.Enabled = false;
- text4.Enabled = false;
- text5.Enabled = false;
- text6.Enabled = false;
- text7.Enabled = false;
- text8.Enabled = false;
- text9.Enabled = false;
- text10.Enabled = false;
- text11.Enabled = false;
- text12.Enabled = false;
- text13.Enabled = false;
- text14.Enabled = false;
- text15.Enabled = false;
- text16.Enabled = false;
- text17.Enabled = false;
- text18.Enabled = false;
- text19.Enabled = false;
- text20.Enabled = false;
- enab = false;
- }
- else
- {
- hk1.Enabled = true;
- hk2.Enabled = true;
- hk3.Enabled = true;
- hk4.Enabled = true;
- hk5.Enabled = true;
- hk6.Enabled = true;
- hk7.Enabled = true;
- hk8.Enabled = true;
- hk9.Enabled = true;
- hk10.Enabled = true;
- hk11.Enabled = true;
- hk12.Enabled = true;
- hk13.Enabled = true;
- hk14.Enabled = true;
- hk15.Enabled = true;
- hk16.Enabled = true;
- hk17.Enabled = true;
- hk18.Enabled = true;
- hk19.Enabled = true;
- hk20.Enabled = true;
- text1.Enabled = true;
- text2.Enabled = true;
- text3.Enabled = true;
- text4.Enabled = true;
- text5.Enabled = true;
- text6.Enabled = true;
- text7.Enabled = true;
- text8.Enabled = true;
- text9.Enabled = true;
- text10.Enabled = true;
- text11.Enabled = true;
- text12.Enabled = true;
- text13.Enabled = true;
- text14.Enabled = true;
- text15.Enabled = true;
- text16.Enabled = true;
- text17.Enabled = true;
- text18.Enabled = true;
- text19.Enabled = true;
- text20.Enabled = true;
- enab = true;
- toolStripStatusLabel5.Text = "Enable Read Only";
- Properties.Settings.Default.enab = true;
- Properties.Settings.Default.Save();
- }
- }
- private void toolStripStatusLabel5_MouseEnter(object sender, EventArgs e)
- {
- this.Cursor = System.Windows.Forms.Cursors.Hand;
- }
- private void toolStripStatusLabel5_MouseLeave(object sender, EventArgs e)
- {
- this.Cursor = System.Windows.Forms.Cursors.Default;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement