Пример #1
0
        private static void DS4TouchpadButtonDown(object sender, TouchpadEventArgs args)
        {
            if (!Settings.Default.EnableTouchpad)
            {
                return;
            }

            // Ignore touchpad if disabled during mouselook
            // Ignore touchpad if disabled during mouselook
            if (Settings.Default.MemoryTouchpadCursorOnly &&
                WoWReader.IsAttached &&
                WoWReader.GameState &&
                WoWReader.MouselookState)
            {
                return;
            }

            switch (Settings.Default.TouchpadMode)
            {
            case 0:
                WoWInput.SendMouseDown(args.touches.Last().hwX < (1920 / 2) ? MouseButton.Left : MouseButton.Right);
                break;

            case 1:
                WoWInput.SendKeyDown(args.touches.Last().hwX < (1920 / 2)
                        ? BindManager.GetKey(GamepadButton.CenterLeft)
                        : BindManager.GetKey(GamepadButton.CenterRight));
                break;
            }
        }
Пример #2
0
        private static void ProcessInput(GamepadButton button, bool state)
        {
            // Do left/right mouse buttons
            if (button == GamepadButton.LeftStick)
            {
                if (state)
                {
                    WoWInput.SendMouseDown(MouseButton.Left);
                }
                else
                {
                    WoWInput.SendMouseUp(MouseButton.Left);
                }
            }
            else if (button == GamepadButton.RightStick)
            {
                if (state)
                {
                    WoWInput.SendMouseDown(MouseButton.Right);
                }
                else
                {
                    WoWInput.SendMouseUp(MouseButton.Right);
                }
            }

            // Do other buttons
            ProcessButton(button, state);
        }
Пример #3
0
        private static void DS4TouchpadButtonDown(object sender, TouchpadEventArgs args)
        {
            if (!Settings.Default.EnableTouchpad)
            {
                return;
            }

            switch (Settings.Default.TouchpadMode)
            {
            case 0:
                WoWInput.SendMouseDown(args.touches.Last().hwX < (1920 / 2) ? MouseButton.Left : MouseButton.Right);
                break;

            case 1:
                WoWInput.SendKeyDown(args.touches.Last().hwX < (1920 / 2)
                        ? BindManager.GetKey(GamepadButton.CenterLeft)
                        : BindManager.GetKey(GamepadButton.CenterRight));
                break;
            }
        }
Пример #4
0
        private static void ProcessInput(GamepadButton button, bool state)
        {
            // Do left/right mouse buttons
            if (button == GamepadButton.LeftStick)
            {
                if (state)
                {
                    WoWInput.SendMouseDown(MouseButton.Left);
                }
                else
                {
                    WoWInput.SendMouseUp(MouseButton.Left);
                }
            }
            else if (button == GamepadButton.RightStick)
            {
                if (state)
                {
                    WoWInput.SendMouseDown(MouseButton.Right);
                }
                else
                {
                    WoWInput.SendMouseUp(MouseButton.Right);
                }
            }

            // Do other buttons
            if (_keyStates[(int)button] != state)
            {
                if (state)
                {
                    WoWInput.SendKeyDown(BindManager.GetKey(button));
                }
                else
                {
                    WoWInput.SendKeyUp(BindManager.GetKey(button));
                }
            }

            _keyStates[(int)button] = state;
        }
Пример #5
0
        private static void ProcessCharacterMenu(GamepadButton button, bool state)
        {
            switch (button)
            {
            case GamepadButton.LFaceUp:
                if (state && !_keyStates[(int)button])
                {
                    WoWInput.SendKeyDown(Key.Up);
                }
                if (!state && _keyStates[(int)button])
                {
                    WoWInput.SendKeyUp(Key.Up);
                }
                break;

            case GamepadButton.LFaceDown:
                if (state && !_keyStates[(int)button])
                {
                    WoWInput.SendKeyDown(Key.Down);
                }
                if (!state && _keyStates[(int)button])
                {
                    WoWInput.SendKeyUp(Key.Down);
                }
                break;

            case GamepadButton.RFaceDown:
                if (state && !_keyStates[(int)button])
                {
                    WoWInput.SendKeyDown(Key.Enter);
                }
                if (!state && _keyStates[(int)button])
                {
                    WoWInput.SendKeyUp(Key.Enter);
                }
                break;

            case GamepadButton.CenterMiddle:
                if (state && !_keyStates[(int)button])
                {
                    WoWInput.SendKeyDown(Key.Escape);
                }
                if (!state && _keyStates[(int)button])
                {
                    WoWInput.SendKeyUp(Key.Escape);
                }
                break;
            }

            // Do left/right mouse buttons
            if (button == GamepadButton.LeftStick)
            {
                if (state)
                {
                    WoWInput.SendMouseDown(MouseButton.Left);
                }
                else
                {
                    WoWInput.SendMouseUp(MouseButton.Left);
                }
            }
            else if (button == GamepadButton.RightStick)
            {
                if (state)
                {
                    WoWInput.SendMouseDown(MouseButton.Right);
                }
                else
                {
                    WoWInput.SendMouseUp(MouseButton.Right);
                }
            }

            _keyStates[(int)button] = state;
        }