Exemplo n.º 1
0
        protected override bool OnCancelPressed(KeyEventArg arg)
        {
            GameController gc = CurrentController as GameController;

            gc.ShowPauseScreen();
            return(true);
        }
Exemplo n.º 2
0
        public bool OnKeyReleased(KeyEventArg arg)
        {
            KeyEntry entry = new KeyEntry(arg, KeyState.Released);

            AddKeyEntry(ref entry);
            return(false);
        }
Exemplo n.º 3
0
        public KeyEvent Init(KeyEventArg arg, KeyState state)
        {
            this.arg   = arg;
            this.state = state;

            return(this);
        }
Exemplo n.º 4
0
        private bool OnKeyRepeat(ref KeyEventArg e)
        {
            KeyCode key = e.key;

            if (key >= KeyCode.A && key <= KeyCode.Z ||
                key >= KeyCode.D0 && key <= KeyCode.D9)
            {
                return(OnKeyPressed(ref e));
            }

            if (key == KeyCode.Left ||
                key == KeyCode.Right ||
                key == KeyCode.Back ||
                key == KeyCode.Delete)
            {
                return(OnKeyPressed(ref e));
            }

            if (e.IsCtrlPressed())
            {
                if (key == KeyCode.Up || key == KeyCode.Down)
                {
                    return(OnKeyPressed(ref e));
                }
            }

            if (keyBindings.ContainsKey(key))
            {
                return(OnKeyPressed(ref e));
            }

            return(false);
        }
Exemplo n.º 5
0
    public void On_Participant_Removed(object sender, KeyEventArg <string> participantArgs)
    {
        var source = (VivoxUnity.IReadOnlyDictionary <string, IParticipant>)sender;

        IParticipant user = source[participantArgs.Key];

        Debug.Log($"{user.Account.Name} has left the channel");
    }
Exemplo n.º 6
0
    private void OnParticipantRemoved(object sender, KeyEventArg <string> participantArgs)
    {
        var source = (VivoxUnity.IReadOnlyDictionary <string, IParticipant>)sender;

        var user = source[participantArgs.Key];

        //Send in-game notification
        Debug.Log($"{user.Account.Name} has left the channel");
    }
Exemplo n.º 7
0
    private void OnParticipantAdded(object sender, KeyEventArg <string> participantArgs)
    {
        var source = (VivoxUnity.IReadOnlyDictionary <string, IParticipant>)sender;
        var user   = source[participantArgs.Key];

        //Send in-game notification
        Debug.Log($"{user.Account.Name} has joined the channel");
        StartCoroutine(RemoteMuteUser(false, serverCredentials.channelSession, user.Account.DisplayName));
    }
        public virtual bool OnKeyReleased(KeyEventArg arg)
        {
            if (!m_console.IsVisible)
            {
                m_keyBindings.OnKeyReleased(arg);
            }

            return(HandleEvent(keyEvent.Init(arg, KeyState.Released)));
        }
Exemplo n.º 9
0
        public bool OnKeyReleased(KeyEventArg arg)
        {
            if (m_frameSkipLookup.ContainsKey(arg.key))
            {
                m_frameSkip = 0;
                return(true);
            }

            return(false);
        }
Exemplo n.º 10
0
        protected virtual bool OnConfirmPressed(KeyEventArg arg)
        {
            if (confirmButton != null)
            {
                OnConfirmButtonPress(confirmButton);
                return(true);
            }

            return(false);
        }
    public void On_Participant_Removed(object sender, KeyEventArg <string> participantArgs)
    {
        var source = (VivoxUnity.IReadOnlyDictionary <string, IParticipant>)sender;

        IParticipant user = source[participantArgs.Key];

        Debug.Log($"{user.Account.Name} has left the channel");
        var temp = Instantiate(lobbyUI.txt_Message_Prefab, lobbyUI.container.transform);

        temp.text = $"{user.Account.Name} has left the channel";
    }
 public void SetKeyPressed(KeyEventArg arg, bool flag)
 {
     if (arg.playerIndex != -1)
     {
         m_gamePads[arg.playerIndex].SetButtonPressed(arg.key, flag);
     }
     else
     {
         m_keyboard.SetKeyPressed(arg.key, flag);
     }
 }
Exemplo n.º 13
0
 protected virtual bool OnCancelPressed(KeyEventArg arg)
 {
     if (cancelButton != null)
     {
         OnCancelButtonPress(cancelButton);
     }
     else
     {
         Finish();
     }
     return(true);
 }
Exemplo n.º 14
0
        //////////////////////////////////////////////////////////////////////////////

        #region IKeyListener

        public bool OnKeyPressed(KeyEventArg arg)
        {
            KeyCode key = arg.key;

            if (key == KeyCode.Space)
            {
                m_stepByStep = !m_stepByStep;
            }
            else if (key == KeyCode.Right)
            {
                if (m_stepByStep)
                {
                    m_shouldRunStep = true;
                }
                else
                {
                    bool shiftPressed = m_inputManager.IsShiftPressed();
                    bool ctrlPressed  = m_inputManager.IsControlPressed();
                    bool altPressed   = m_inputManager.IsAltPressed();

                    if (shiftPressed && ctrlPressed && altPressed)
                    {
                        m_skipTime = 60.0f;
                    }
                    else if (shiftPressed && ctrlPressed)
                    {
                        m_skipTime = 30.0f;
                    }
                    else if (shiftPressed)
                    {
                        m_skipTime = 10.0f;
                    }
                    else if (ctrlPressed)
                    {
                        m_skipTime = 5.0f;
                    }
                    else
                    {
                        m_skipTime = 1.0f;
                    }
                }
            }
            else
            {
                int skip;
                if (m_frameSkipLookup.TryGetValue(key, out skip))
                {
                    m_frameSkip = skip;
                }
            }

            return(false);
        }
Exemplo n.º 15
0
        public bool OnKeyPressed(KeyEventArg arg)
        {
            KeyCode code = arg.key;
            String  cmd  = FindCmd(code);

            if (cmd != null)
            {
                TryExecuteCommand(cmd);
                return(true);
            }

            return(false);
        }
        //////////////////////////////////////////////////////////////////////////////

        #region Key listener

        public override bool OnKeyPressed(KeyEventArg e)
        {
            if (base.OnKeyPressed(e))
            {
                return(true);
            }

            if (e.key == KeyCode.Oem8)
            {
                ToggleConsole();
                return(true);
            }

            return(false);
        }
Exemplo n.º 17
0
 public bool OnKeyRepeated(KeyEventArg arg)
 {
     return(false);
 }
Exemplo n.º 18
0
 public virtual bool OnKeyRepeated(KeyEventArg arg)
 {
     return(HandleEvent(keyEvent.Init(arg, KeyState.Repeated)));
 }
Exemplo n.º 19
0
 private bool OnKeyReleased(ref KeyEventArg e)
 {
     return(false);
 }
 public void FireKeyReleased(KeyEventArg arg)
 {
     NotifyKeyReleased(ref arg);
 }
Exemplo n.º 21
0
        //////////////////////////////////////////////////////////////////////////////

        #region Input

        private bool OnKeyPressed(ref KeyEventArg e)
        {
            KeyCode key = e.key;

            if (e.IsCtrlPressed())
            {
                if (key == KeyCode.Left)
                {
                    MoveCursorWordLeft();
                    return(true);
                }

                if (key == KeyCode.Right)
                {
                    MoveCursorWordRight();
                    return(true);
                }

                if (key == KeyCode.Up)
                {
                    ScrollUp();
                    return(true);
                }

                if (key == KeyCode.Down)
                {
                    ScrollDown();
                    return(true);
                }

                if (key == KeyCode.A)
                {
                    MoveCursorHome();
                    return(true);
                }

                if (key == KeyCode.E)
                {
                    MoveCursorEnd();
                    return(true);
                }
            }

            if (e.IsShiftPressed())
            {
                char bindShiftChr;
                if (keyShiftBindings.TryGetValue(key, out bindShiftChr))
                {
                    EnterChar(bindShiftChr);
                    return(true);
                }
            }

            if (key >= KeyCode.A && key <= KeyCode.Z)
            {
                char chr = (char)key;
                if (!e.IsShiftPressed())
                {
                    chr = char.ToLower(chr);
                }

                EnterChar(chr);
                return(true);
            }

            if (key >= KeyCode.D0 && key <= KeyCode.D9 || key == KeyCode.Space)
            {
                EnterChar((char)key);
                return(true);
            }

            if (key == KeyCode.Left)
            {
                MoveCursorLeft();
                return(true);
            }

            if (key == KeyCode.Right)
            {
                MoveCursorRight();
                return(true);
            }

            if (key == KeyCode.Up)
            {
                PrevHistory();
                return(true);
            }

            if (key == KeyCode.Down)
            {
                NextHistory();
                return(true);
            }

            if (key == KeyCode.Back)
            {
                DeletePrevChar();
                return(true);
            }

            if (key == KeyCode.Delete)
            {
                DeleteNextChar();
                return(true);
            }

            if (key == KeyCode.Enter)
            {
                TryExecuteCommand();
                return(true);
            }

            if (key == KeyCode.Tab)
            {
                DoAutoComplete();
                return(true);
            }

            if (key == KeyCode.Home)
            {
                MoveCursorHome();
                return(true);
            }

            if (key == KeyCode.End)
            {
                MoveCursorEnd();
                return(true);
            }

            if (key == KeyCode.Escape)
            {
                Clear();
                return(true);
            }

            char bindChr;

            if (keyBindings.TryGetValue(key, out bindChr))
            {
                EnterChar(bindChr);
                return(true);
            }

            return(false);
        }
 private void OnParticipantJoined(object sender, KeyEventArg <string> e)
 {
     //Debug.Log($"[Vivox] Participant [{e.Key}]  joined");
     onVivoxParticipantJoined?.Invoke(loginSession.GetChannelSession(channelId).Participants[e.Key]);
 }
Exemplo n.º 23
0
 public bool OnKeyReleased(KeyEventArg arg)
 {
     return(m_inputCmd.OnKeyReleased(arg));
 }
Exemplo n.º 24
0
        public bool OnKeyReleased(KeyEventArg arg)
        {
            KeyCode code = arg.key;

            return(FindCmd(code) != null);
        }
Exemplo n.º 25
0
 public KeyEntry(KeyEventArg arg, KeyState state)
 {
     this.arg   = arg;
     this.state = state;
 }
 public void FireKeyPressed(KeyEventArg arg)
 {
     NotifyKeyPressed(ref arg);
 }