public override void Activate() { if (!KeyboardInterface.Send("Key_Escape")) { Debug.LogWarning("Could not send keypress Key_Escape, did not understand the key"); } }
private void NavigateDirection(Direction direction) { if (directionKeys.ContainsKey(direction)) { var key = directionKeys[direction]; KeyboardInterface.Send(key); } }
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)); } } }
private void Select() { KeyboardInterface.Send("Key_Space"); }