は、ここでは簡単な擬似コードの例です:
public void Update(GameTime pGameTime)
{
private TimeSpan mKeyDuration = TimeSpan.FromSeconds(0);
...
if key is pressed this frame
mKeyDuration += pGameTime.ElapsedGameTime;
else if key was pressed last frame
mKeyDuration = TimeSpan.FromSeconds(0);
...
}
:あなたはこのようなものになるだろうと言うと、特に時間を測定するため
// to cancel immediately
if key is pressed this frame, but was released last frame
begin effect
else if key is pressed this frame, and also was last frame
increase magnitude of effect
else if key is released this frame and effect is active
end effect
// or to gradually decrease
if key is pressed this frame, and effect is inactive
begin effect
else if key is pressed this frame, and effect is active
increase magnitude of effect
else if key is released this frame and effect is active
decrease magnitude of effect
if magnitude decreased enough, end effect
私がXを読んでいる限り、 NA KeyboardStateのドキュメントでは、説明したようなKeyboardStateクラスにはそのような制限はありません。 [MSDNドキュメント](http://msdn.microsoft.com/en-us/library/bb203903%28v=xnagamestudio.10%29.aspx)から判断すると、現在の状態を取得するために使用できます。どれくらいの数のキーが押されていても、どれくらい長く押されていようとも、すべてのキー。おそらくあなたの入力コードに問題がありますか? –
それを確認していただきありがとうございます、私は自分の発見を自分で確認しました。 また、私は入力の仕組みも認識しています。それはもっと設計/アーキテクチャーの解決策を探していただけです。 – CodinRonin