/// <summary> /// Press the current active key /// </summary> public void PressKey() { if (ActiveKey != null) { ActiveKey.Press(); } }
/// <summary> /// Activate the selected key and press it /// </summary> /// <param name="key"></param> public void PressKey(KeyboardKey key) { if (key != null) { EventSystem.current.SetSelectedGameObject(key.gameObject); ActiveKey = key; key.Press(); } }