本文整理汇总了C#中InputHelper.GetKey方法的典型用法代码示例。如果您正苦于以下问题:C# InputHelper.GetKey方法的具体用法?C# InputHelper.GetKey怎么用?C# InputHelper.GetKey使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类InputHelper
的用法示例。
在下文中一共展示了InputHelper.GetKey方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: checkHeld
private void checkHeld(InputHelper.CommandMove command, InputHelper.KeyState currentKeyState)
{
int held = 0;
Debug.WriteLine("HELD KEY: " + currentKeyState.GetState());
currentKeyState = command.GetCurrentMove();
if (command.IsMaxNegativeReached() == true)
{
command.Reset();
held = 0;
}
if (releasedState.GetCurrentInputState() != InputHelper.KeyPress.NONE)
{
if (releasedState.GetCurrentInputState() == currentKeyState.GetKey()
|| (releasedState.GetCurrentInputState(releasedState.GetCurrentStateStep()-2) == currentKeyState.GetKey()
&& releasedState.GetCurrentInputState() != currentKeyState.GetKey()))
{
command.Reset();
}
}
for (int i = 0; i < heldState.GetBuffer().Count - 1; i++)
{
bool reset = (releasedState.GetBuffer().Count >= i + 2
&& releasedState.GetBuffer()[i + 1] == currentKeyState.GetKey());
if (reset)
{
held = 0;
command.IncrementNegativeCount();
break;
}
if (heldState.GetBuffer()[i + 1] == currentKeyState.GetKey())
{
held++;
command.ResetNegativeEdge();
}
else
{
held = 0;
command.Reset();
break;
}
}
Debug.WriteLine("HELD COUNT: " + held);
Debug.WriteLine("HELD TIME: " + currentKeyState.GetKeyHeldTime());
if (held >= currentKeyState.GetKeyHeldTime())
{
command.Next();
}
else
{
command.IncrementNegativeCount();
}
}