private void OnInteractionControllerKeyInput(object?sender, KeyInputArgs e) { this.playerControllerReporter?.KeyInput(e.KeyInput); switch (e.KeyInput) { case KeyInput.PlayPause: case KeyInput.Ok: case KeyInput.Stop: this.playbackControls.PauseResumeAsync(); break; case KeyInput.Next: case KeyInput.Right: this.playbackControls.NextAsync(); break; case KeyInput.Previous: case KeyInput.Left: this.playbackControls.PreviousAsync(); break; case KeyInput.Menu: this.menuRequester.RequestMenu(); break; } }
// Use this for initialization private void Start() { InputObserver.onInputDown += (InputArgs args) => { if (args is KeyInputArgs) { KeyInputArgs keyArgs = (KeyInputArgs)args; // Debug.Log(args is MouseInputArgs); // Debug.Log(args is TouchInputArgs); // Debug.Log(args is KeyInputArgs); Debug.Log("The " + keyArgs.keyCode.ToString() + " key is pressed down at " + keyArgs.time.ToString("0.00") + " seconds."); } }; InputObserver.onInput += (InputArgs args) => { if (args is KeyInputArgs) { KeyInputArgs keyArgs = (KeyInputArgs)args; Debug.Log("The " + keyArgs.keyCode.ToString() + " key is held down at " + keyArgs.time.ToString("0.00") + " seconds."); } }; InputObserver.onInputUp += (InputArgs args) => { if (args is KeyInputArgs) { KeyInputArgs keyArgs = (KeyInputArgs)args; Debug.Log("The " + keyArgs.keyCode.ToString() + " key is released at " + keyArgs.time.ToString("0.00") + " seconds."); } }; }
private string ProcessKeyInput(KeyInputArgs args) { if (args.Text.First() == Chars.Backspace) { return(new string(Text.DropLast(1).ToArray())); } return(string.Concat(Text, args.Text)); }
private void OnInteractionControllerKeyInput(object?sender, KeyInputArgs e) { this.volumeControllerReporter?.KeyInput(e.KeyInput); switch (e.KeyInput) { case KeyInput.Down: this.volumeService.ChangeVolumeAsync(false).Wait(); break; case KeyInput.Up: this.volumeService.ChangeVolumeAsync(true).Wait(); break; case KeyInput.Select: this.volumeService.ToggleMuteAsync().Wait(); break; } }
private void OnInteractionControllerKeyInput(object?sender, KeyInputArgs keyInputArgs) { this.textViewNavigator.NavigateBackAsync().Wait(); this.Exit?.Invoke(this, EventArgs.Empty); }