diff --git a/.vs/HaoYue.BF3ChineseInput/v15/Server/sqlite3/storage.ide b/.vs/HaoYue.BF3ChineseInput/v15/Server/sqlite3/storage.ide index 56758a8..0d5a52c 100644 Binary files a/.vs/HaoYue.BF3ChineseInput/v15/Server/sqlite3/storage.ide and b/.vs/HaoYue.BF3ChineseInput/v15/Server/sqlite3/storage.ide differ diff --git a/.vs/HaoYue.BF3ChineseInput/v15/Server/sqlite3/storage.ide-shm b/.vs/HaoYue.BF3ChineseInput/v15/Server/sqlite3/storage.ide-shm index b6c1ef2..cb2c87c 100644 Binary files a/.vs/HaoYue.BF3ChineseInput/v15/Server/sqlite3/storage.ide-shm and b/.vs/HaoYue.BF3ChineseInput/v15/Server/sqlite3/storage.ide-shm differ diff --git a/.vs/HaoYue.BF3ChineseInput/v15/Server/sqlite3/storage.ide-wal b/.vs/HaoYue.BF3ChineseInput/v15/Server/sqlite3/storage.ide-wal index a6a5582..c74405a 100644 Binary files a/.vs/HaoYue.BF3ChineseInput/v15/Server/sqlite3/storage.ide-wal and b/.vs/HaoYue.BF3ChineseInput/v15/Server/sqlite3/storage.ide-wal differ diff --git a/HaoYue.BF3ChineseInput/MainWindow.xaml b/HaoYue.BF3ChineseInput/MainWindow.xaml index 46bb87f..e4b0f9a 100644 --- a/HaoYue.BF3ChineseInput/MainWindow.xaml +++ b/HaoYue.BF3ChineseInput/MainWindow.xaml @@ -5,9 +5,9 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:local="clr-namespace:HaoYue.BF3ChineseInput" mc:Ignorable="d" - Title="MainWindow" Height="450" Width="800"> + Title="MainWindow" Height="95.195" Width="376.122"> - + diff --git a/HaoYue.BF3ChineseInput/MainWindow.xaml.cs b/HaoYue.BF3ChineseInput/MainWindow.xaml.cs index 1db0764..679d759 100644 --- a/HaoYue.BF3ChineseInput/MainWindow.xaml.cs +++ b/HaoYue.BF3ChineseInput/MainWindow.xaml.cs @@ -37,22 +37,33 @@ namespace HaoYue.BF3ChineseInput char i = e.KeyChar; //System.Windows.Forms.MessageBox.Show(i.ToString()); + //text1.Text += i; text1.Text += i; //判断按下的键(Alt + A) - if (i == 'j' && (int)System.Windows.Forms.Control.ModifierKeys == (int)Keys.Alt) - { - System.Windows.Forms.MessageBox.Show("ddd"); - } + //if (i == 'j' && (int)System.Windows.Forms.Control.ModifierKeys == (int)Keys.Alt) + //{ + // text1.Text += i; + //} + + ////判断按下的键(Alt + A) + //if (i == 'j' || i == 'k' || i == 'l') + //{ + // //int pid = 0;//获取当前进程的PID + // //GetWindowThreadProcessId(GetForegroundWindow(), out pid); + // SetForegroundWindow(new IntPtr(21404)); + //} } - [System.Runtime.InteropServices.DllImport("user32.dll", EntryPoint = "GetForegroundWindow", CharSet = System.Runtime.InteropServices.CharSet.Auto, ExactSpelling = true)] - public static extern IntPtr GetF(); //获得本窗体的句柄 - [System.Runtime.InteropServices.DllImport("user32.dll", EntryPoint = "SetForegroundWindow")] - public static extern bool SetF(IntPtr hWnd); //设置此窗体为活动窗体 + public static extern IntPtr GetForegroundWindow(); //获得本窗体的句柄 + [System.Runtime.InteropServices.DllImport("user32.dll", EntryPoint = "SetForegroundWindow")] + public static extern bool SetForegroundWindow(IntPtr hWnd); //设置此窗体为活动窗体 + + [System.Runtime.InteropServices.DllImport("User32.dll", CharSet = System.Runtime.InteropServices.CharSet.Auto)] + public static extern int GetWindowThreadProcessId(IntPtr hwnd, out int ID); //private void timer1_Tick(object sender, EventArgs e) //{ // if (this.Handle != GetF()) //如果本窗口没有获得焦点 @@ -63,7 +74,6 @@ namespace HaoYue.BF3ChineseInput { text1.Text += (char)e.KeyData; - //判断按下的键(Alt + A) //if (e.KeyValue == (int)Keys.A && (int)System.Windows.Forms.Control.ModifierKeys == (int)Keys.Alt) //{