コード例 #1
0
 public override void Activate()
 {
     if (!KeyboardInterface.Send("Key_Escape"))
     {
         Debug.LogWarning("Could not send keypress Key_Escape, did not understand the key");
     }
 }
コード例 #2
0
 private void NavigateDirection(Direction direction)
 {
     if (directionKeys.ContainsKey(direction))
     {
         var key = directionKeys[direction];
         KeyboardInterface.Send(key);
     }
 }
コード例 #3
0
        public override void Activate()
        {
            var control = controlButtonAsset.GetControl();

            var bindings = EDStateManager.instance.controlBindings;

            if (bindings == null)
            {
                Debug.LogWarning("Control bindings not loaded");
            }
            else
            {
                var      keyBinding = bindings.GetKeyboardKeybinding(control);
                string   key        = "";
                string[] modifiers  = null;
                if (keyBinding == null)
                {
                    if (!controlButtonAsset.GetDefaultKeycombo(ref key, ref modifiers))
                    {
                        Debug.LogWarningFormat("Control was not bound and there is no default keycombo to fallback to");
                        return;
                    }
                }
                else
                {
                    key       = keyBinding.Value.Key;
                    modifiers = keyBinding.Value.Modifiers.Select(mod => mod.Key).ToArray();
                }

                if (!KeyboardInterface.Send(key, modifiers))
                {
                    Debug.LogWarningFormat(
                        "Could not send keypress {0}, did not understand one or more of the keys",
                        KeyboardInterface.KeyComboDebugString(key, modifiers));
                }
            }
        }
コード例 #4
0
 private void Select()
 {
     KeyboardInterface.Send("Key_Space");
 }