当前位置: 首页>>代码示例>>C#>>正文


C# Input.IsKeyReleased方法代码示例

本文整理汇总了C#中Input.IsKeyReleased方法的典型用法代码示例。如果您正苦于以下问题:C# Input.IsKeyReleased方法的具体用法?C# Input.IsKeyReleased怎么用?C# Input.IsKeyReleased使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Input的用法示例。


在下文中一共展示了Input.IsKeyReleased方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ProcessKeyboard

        /// <summary>
        /// Focuses the previous or next selection button depending on if the UP or DOWN arrow keys were pressed.
        /// </summary>
        /// <param name="info">The keyboard state.</param>
        public override bool ProcessKeyboard(Input.KeyboardInfo info)
        {
            base.ProcessKeyboard(info);

            if (info.IsKeyReleased(Microsoft.Xna.Framework.Input.Keys.Up) && PreviousSelection != null)
            {
                PreviousSelection.IsFocused = true;

                return true;
            }

            else if (info.IsKeyReleased(Microsoft.Xna.Framework.Input.Keys.Down) && NextSelection != null)
            {
                NextSelection.IsFocused = true;

                return true;
            }

            return false;
        }
开发者ID:drock07,项目名称:SadConsole,代码行数:24,代码来源:SelectionButton.cs

示例2: ProcessKeyboard

 /// <summary>
 /// Processes the keyboard looking for the ESC key press to close the console, if required. Otherwise the base ControlsConsole will process the keyboard.
 /// </summary>
 /// <param name="info">Keyboard state.</param>
 public override bool ProcessKeyboard(Input.KeyboardInfo info)
 {
     if (CloseOnESC && info.IsKeyReleased(Microsoft.Xna.Framework.Input.Keys.Escape))
     {
         this.Hide();
         return true;
     }
     else
         return base.ProcessKeyboard(info);
 }
开发者ID:TyrelBaux,项目名称:SadConsole,代码行数:14,代码来源:Window.cs

示例3: ProcessKeyboard

        /// <summary>
        /// Called when the control should process keyboard information.
        /// </summary>
        /// <param name="info">The keyboard information.</param>
        /// <returns>True if the keyboard was handled by this control.</returns>
        public override bool ProcessKeyboard(Input.KeyboardInfo info)
        {
            if (info.IsKeyReleased(Microsoft.Xna.Framework.Input.Keys.Space) || info.IsKeyReleased(Microsoft.Xna.Framework.Input.Keys.Enter))
            {
                IsSelected = !IsSelected;

                return true;
            }
            else if (Parent != null)
            {
                if (info.IsKeyReleased(Microsoft.Xna.Framework.Input.Keys.Up))
                    Parent.TabPreviousControl();

                else if (info.IsKeyReleased(Microsoft.Xna.Framework.Input.Keys.Down))
                    Parent.TabNextControl();

                return true;
            }

            return false;
        }
开发者ID:drock07,项目名称:SadConsole,代码行数:26,代码来源:Checkbox.cs

示例4: ProcessKeyboard

        /// <summary>
        /// Detects if the SPACE and ENTER keys are pressed and calls the <see cref="Click"/> method.
        /// </summary>
        /// <param name="info"></param>
        public override bool ProcessKeyboard(Input.KeyboardInfo info)
        {
            if (info.IsKeyReleased(Microsoft.Xna.Framework.Input.Keys.Space) || info.IsKeyReleased(Microsoft.Xna.Framework.Input.Keys.Enter))
            {
                Click();
                return true;
            }

            return false;
        }
开发者ID:drock07,项目名称:SadConsole,代码行数:14,代码来源:Button.cs


注:本文中的Input.IsKeyReleased方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。