本文整理汇总了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;
}
示例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);
}
示例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;
}
示例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;
}