rm KeyboardInput
GitOrigin-RevId: 1725d577c5be04488a6723b65c0c93fa25d12ab5
This commit is contained in:
parent
660d163119
commit
361a02c67f
@ -1,24 +0,0 @@
|
||||
using Microsoft.Xna.Framework.Input;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SemiColinGames {
|
||||
public class KeyboardInput {
|
||||
private KeyboardState oldState = Keyboard.GetState();
|
||||
private List<Keys> newKeysDown = new List<Keys>();
|
||||
|
||||
public void Update() {
|
||||
KeyboardState newState = Keyboard.GetState();
|
||||
newKeysDown.Clear();
|
||||
foreach (Keys k in newState.GetPressedKeys()) {
|
||||
if (!oldState.IsKeyDown(k)) {
|
||||
newKeysDown.Add(k);
|
||||
}
|
||||
}
|
||||
oldState = newState;
|
||||
}
|
||||
|
||||
public List<Keys> NewKeysDown() {
|
||||
return newKeysDown;
|
||||
}
|
||||
}
|
||||
}
|
@ -14,9 +14,8 @@
|
||||
<Compile Include="$(MSBuildThisFileDirectory)FpsCounter.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)History.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)IDisplay.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)KeyboardInput.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Player.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)SneakGame.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)World.cs" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
</Project>
|
@ -15,7 +15,6 @@
|
||||
<Compile Include="History.cs" />
|
||||
<Compile Include="IDisplay.cs" />
|
||||
<Compile Include="SneakGame.cs" />
|
||||
<Compile Include="KeyboardInput.cs" />
|
||||
<Compile Include="Player.cs" />
|
||||
<Compile Include="World.cs" />
|
||||
</ItemGroup>
|
||||
@ -24,4 +23,4 @@
|
||||
</ItemGroup>
|
||||
<Import Project="Shared.projitems" Label="Shared" />
|
||||
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.CSharp.targets" />
|
||||
</Project>
|
||||
</Project>
|
Loading…
Reference in New Issue
Block a user