private void Keyboard_KeyEvent(object sender, WindowsInput.EventSources.EventSourceEventArgs <WindowsInput.EventSources.KeyboardEvent> e)
 {
     if (curAssignment != null && e.Data.KeyDown != null)
     {
         Config.SetValue((string)curAssignment.Tag, "key_" + ((int)e.Data.KeyDown.Key));
         AsyncPrettyName(curAssignment);
         curAssignment       = null;
         e.Next_Hook_Enabled = false;
     }
 }
 private void Mouse_MouseEvent(object sender, WindowsInput.EventSources.EventSourceEventArgs <WindowsInput.EventSources.MouseEvent> e)
 {
     if (curAssignment != null && e.Data.ButtonDown != null)
     {
         Config.SetValue((string)curAssignment.Tag, "mse_" + ((int)e.Data.ButtonDown.Button));
         AsyncPrettyName(curAssignment);
         curAssignment       = null;
         e.Next_Hook_Enabled = false;
     }
 }
Ejemplo n.º 3
0
        private static void Keyboard_KeyEvent(object sender, WindowsInput.EventSources.EventSourceEventArgs <WindowsInput.EventSources.KeyboardEvent> e)
        {
            if (e.Data.KeyDown != null)
            {
                string res_val = Config.Value("reset_mouse");
                if (res_val.StartsWith("key_"))
                {
                    if ((int)e.Data.KeyDown.Key == Int32.Parse(res_val.Substring(4)))
                    {
                        var rMouse = true;
                        foreach (var i in mgr.j)
                        {
                            i.gyroXJoy = 0;
                            i.gyroYJoy = 0;
                            rMouse     = i.gyroJoyActive;
                        }
                        if (!rMouse)
                        {
                            WindowsInput.Simulate.Events().MoveTo(Screen.PrimaryScreen.Bounds.Width / 2, Screen.PrimaryScreen.Bounds.Height / 2).Invoke();
                        }
                    }
                }

                res_val = Config.Value("active_gyro");
                if (res_val.StartsWith("key_"))
                {
                    if ((int)e.Data.KeyDown.Key == Int32.Parse(res_val.Substring(4)))
                    {
                        foreach (var i in mgr.j)
                        {
                            i.active_gyro = true;
                        }
                    }
                }
            }

            if (e.Data.KeyUp != null)
            {
                string res_val = Config.Value("active_gyro");
                if (res_val.StartsWith("key_"))
                {
                    if ((int)e.Data.KeyUp.Key == Int32.Parse(res_val.Substring(4)))
                    {
                        foreach (var i in mgr.j)
                        {
                            i.active_gyro = false;
                        }
                    }
                }
            }
        }
Ejemplo n.º 4
0
        private static void Mouse_MouseEvent(object sender, WindowsInput.EventSources.EventSourceEventArgs <WindowsInput.EventSources.MouseEvent> e)
        {
            if (e.Data.ButtonDown != null)
            {
                string res_val = Config.Value("reset_mouse");
                if (res_val.StartsWith("mse_"))
                {
                    if ((int)e.Data.ButtonDown.Button == Int32.Parse(res_val.Substring(4)))
                    {
                        WindowsInput.Simulate.Events().MoveTo(Screen.PrimaryScreen.Bounds.Width / 2, Screen.PrimaryScreen.Bounds.Height / 2).Invoke();
                    }
                }

                res_val = Config.Value("active_gyro");
                if (res_val.StartsWith("mse_"))
                {
                    if ((int)e.Data.ButtonDown.Button == Int32.Parse(res_val.Substring(4)))
                    {
                        foreach (var i in mgr.j)
                        {
                            i.active_gyro = true;
                        }
                    }
                }
            }

            if (e.Data.ButtonUp != null)
            {
                string res_val = Config.Value("active_gyro");
                if (res_val.StartsWith("mse_"))
                {
                    if ((int)e.Data.ButtonUp.Button == Int32.Parse(res_val.Substring(4)))
                    {
                        foreach (var i in mgr.j)
                        {
                            i.active_gyro = false;
                        }
                    }
                }
            }
        }