Exemple #1
0
 private void MainForm_Load(object sender, EventArgs e)
 {
     if (File.Exists(ConfigFile))
     {
         KbManager.LoadConfig(ConfigFile);
     }
     else
     {
         KbManager.LoadDefaultConfig();
         KbManager.Save(ConfigFile);
     }
     UpdatePanels();
 }
Exemple #2
0
        public MainForm()
        {
            InitializeComponent();

            Text     += " - Version " + System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString();
            KbManager = new KeyManagerData(ConfigFile);

            keyboardHook           = new KeyboardHookListener(new GlobalHooker());
            keyboardHook.KeyPress += new KeyPressEventHandler(keyboardHook_KeyPress);
            keyboardHook.KeyDown  += new KeyEventHandler(keyboardHook_KeyDown);
            keyboardHook.KeyUp    += new KeyEventHandler(keyboardHook_KeyUp);
            keyboardHook.Enabled   = true;

            //Get properties from btRef
            refButton        = new Button();
            refButton.Width  = btRef.Width;
            refButton.Height = btRef.Height;

            //Default Settings - Debug
            KbManager.LoadDefaultConfig();
            Armed    = true;
            keyIndex = 0;
        }