예제 #1
0
        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;
            }
        }
예제 #2
0
    // 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.");
            }
        };
    }
예제 #3
0
파일: TextBox.cs 프로젝트: punker76/OmniGUI
        private string ProcessKeyInput(KeyInputArgs args)
        {
            if (args.Text.First() == Chars.Backspace)
            {
                return(new string(Text.DropLast(1).ToArray()));
            }

            return(string.Concat(Text, args.Text));
        }
예제 #4
0
        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;
            }
        }
예제 #5
0
 private void OnInteractionControllerKeyInput(object?sender, KeyInputArgs keyInputArgs)
 {
     this.textViewNavigator.NavigateBackAsync().Wait();
     this.Exit?.Invoke(this, EventArgs.Empty);
 }