void IScrollHandler.OnScroll(PointerEventData eventData)
        {
            var key = eventData.scrollDelta.y > 0
                                ? KeysConverter.Convert(KeyCode.UpArrow)
                                : KeysConverter.Convert(KeyCode.DownArrow);

            browserKeyboard.KeyDown(key);
        }
Exemplo n.º 2
0
        private void Update()
        {
            if (InputProxy.GetKeyUp(KeyCode.Escape))
            {
                EscapePressed?.Invoke();
            }

            foreach (var pair in ModificationKeys)
            {
                if (InputProxy.GetKeyDown(pair.Key))
                {
                    keyboardInput.KeyDown(pair.Value);
                }

                if (InputProxy.GetKeyUp(pair.Key))
                {
                    keyboardInput.KeyUp(pair.Value);
                }
            }

            foreach (var pair in NumpadKeys)
            {
                if (InputProxy.GetKeyDown(pair.Key))
                {
                    keyboardInput.PressKey(pair.Value);
                }
            }

            AllKeyCodes.ForEach(code =>
            {
                if (InputProxy.GetKeyDown(code))
                {
                    var key = KeysConverter.Convert(code);
                    keyboardInput.PressKey(key);
                }
            });
        }
    private void Update()
    {
        ManualHandleOfKeyCode(KeyCode.LeftShift, "Shift");
        ManualHandleOfKeyCode(KeyCode.RightShift, "Shift");
        ManualHandleOfKeyCode(KeyCode.LeftAlt, "Alt");
        ManualHandleOfKeyCode(KeyCode.RightAlt, "Alt");
        ManualHandleOfKeyCode(KeyCode.LeftControl, "Control");
        ManualHandleOfKeyCode(KeyCode.RightControl, "Control");

        if (Input.GetKeyUp(KeyCode.Escape))
        {
            EscapePressed?.Invoke();
        }

        AllKeyCodes.ForEach(code =>
        {
            if (!Input.GetKeyDown(code))
            {
                return;
            }
            var key = KeysConverter.Convert(code);
            keyboardInput.PressKey(key);
        });
    }