private void ProcessHotkeys(string _)
 {
     if (InputProxy.GetKeyDown(KeyCode.Return) || InputProxy.GetKeyDown(KeyCode.KeypadEnter))
     {
         RequestSearch();
     }
     else if (InputProxy.GetKeyDown(KeyCode.Escape))
     {
         ClearSearch();
     }
 }
        IEnumerator SomeHotkeyCoroutine()
        {
            while (true)
            {
                yield return(new WaitForSeconds(_timeout));

                yield return(new WaitUntil(() => InputProxy.GetKeyDown(_keyCode)));

                if (!m_isLocked)
                {
                    KeyPressedEvent?.Invoke();
                }
            }
        }
Esempio n. 3
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);
                }
            });
        }