private void comboBox1_TextChanged(object sender, EventArgs e) { int index = comboBox1.SelectedIndex; switch (index) { case 0: this.tableFilename = "jp-jp.tbl"; break; case 1: this.tableFilename = "en-jp.tbl"; break; case 2: this.tableFilename = "jp-en.tbl"; break; case 3: this.tableFilename = "en-en.tbl"; break; default: break; } string appFile = System.Reflection.Assembly.GetExecutingAssembly().Location; string appPath = System.IO.Directory.GetParent(appFile).FullName; keyChangeTable_ = new KeyChangeTable(appPath + "\\" + tableFilename); Apply(); }
private void Form1_Load(object sender, EventArgs e) { txtProcessName.Text = Properties.Settings.Default.ProcessName; txtWindowText.Text = Properties.Settings.Default.WindowText; string appFile = System.Reflection.Assembly.GetExecutingAssembly().Location; string appPath = System.IO.Directory.GetParent(appFile).FullName; keyChangeTable_ = new KeyChangeTable(appPath + "\\keychange.tbl"); Apply(); kbdHook_ = new KeyboardHook(); kbdHook_.LowLevelKeyboardEvent += KbdHook__LowLevelKeyboardEvent; }