IsKeyReleased() public méthode

Returns true when they is in the KeysReleased collection.
public IsKeyReleased ( Keys key ) : bool
key Keys The key to check.
Résultat bool
        public override bool ProcessKeyboard(KeyboardInfo info)
        {
            if (info.IsKeyReleased(Microsoft.Xna.Framework.Input.Keys.Space))
                animation.Restart();

            return base.ProcessKeyboard(info);
        }
Exemple #2
0
        public override bool ProcessKeyboard(KeyboardInfo info)
        {
            // If the space key is pressed, run the fade
            if (info.IsKeyReleased(Keys.Space))
                startFade = true;

            // Do not pass the keyboard input to the child consoles, eat it.
            return true;
        }
Exemple #3
0
        public override bool ProcessKeyboard(KeyboardInfo info)
        {
            if (info.IsKeyReleased(Keys.Space))
            {
                Renderer = _renderer == oldRenderer ? cachedRenderer : oldRenderer;
                TextSurface.Tint = _renderer == oldRenderer ? Color.Transparent : new Color(255, 255, 255, 70);
            }

            return false;
        }
        public override bool ProcessKeyboard(KeyboardInfo info)
        {
            bool shifted = info.IsKeyDown(Microsoft.Xna.Framework.Input.Keys.LeftShift) || info.IsKeyDown(Microsoft.Xna.Framework.Input.Keys.RightShift);

            if (shifted && info.IsKeyReleased(Microsoft.Xna.Framework.Input.Keys.Down))
            {
                currentCharSet++;

                if (currentCharSet >= CharacterSets.Length)
                    currentCharSet = 0;

                Characters = CharacterSets[currentCharSet];
                Redraw();
                return true;
            }
            else if (shifted && info.IsKeyReleased(Microsoft.Xna.Framework.Input.Keys.Up))
            {
                currentCharSet--;

                if (currentCharSet < 0)
                    currentCharSet = CharacterSets.Length - 1;

                Characters = CharacterSets[currentCharSet];
                Redraw();
                return true;
            }

            foreach (var key in info.KeysPressed)
            {
                for (int i = 0; i < keys.Length; i++)
                {
                    if (key == keys[i])
                    {
                        Panels.CharacterPickPanel.SharedInstance.SettingCharacter = Characters[i];
                        return true;
                    }
                }
            }

            return false;
        }
Exemple #5
0
        public override bool ProcessKeyboard(KeyboardInfo info)
        {
            if (info.IsKeyReleased(Keys.C))
            {
                backIndex++;

                if (backIndex == backgroundcycle.Length)
                    backIndex = 0;

                var theme = Theme;
                theme.FillStyle.Background = backgroundcycle[backIndex];
                Theme = theme;

            }

            return base.ProcessKeyboard(info);
        }
        public bool ProcessKeyboard(KeyboardInfo info)
        {
            bool toolHandled = toolsPanel.SelectedTool.ProcessKeyboard(info, textSurface);

            if (!toolHandled)
            {
                if (info.IsKeyReleased(Microsoft.Xna.Framework.Input.Keys.OemOpenBrackets))
                {
                    framesPanel.TryPreviousFrame();
                    return true;
                }

                else if (info.IsKeyReleased(Microsoft.Xna.Framework.Input.Keys.OemCloseBrackets))
                {
                    framesPanel.TryNextFrame();
                    return true;
                }
                else
                {
                    var keys = info.KeysReleased.Select(k => k.Character).ToList();

                    foreach (var item in tools.Values)
                    {
                        if (keys.Contains(item.Hotkey))
                        {
                            SelectedTool = item;
                            return true;
                        }
                    }
                }
            }

            return false;
        }