summaryrefslogtreecommitdiff
path: root/WindowsPhone
diff options
context:
space:
mode:
authorIan C <ianc@noddybox.co.uk>2012-05-27 22:18:17 +0000
committerIan C <ianc@noddybox.co.uk>2012-05-27 22:18:17 +0000
commit60b52b009c2f74cea7d5ffb0ad62cbbc55c41729 (patch)
treedcc5a467f604fb01f8568f18e5b3d1e26d094566 /WindowsPhone
parent299769ecba0a96ca8dc9551a639b9e5e6d23b3d2 (diff)
Updated keyboard to chain itself to InputManager.
Diffstat (limited to 'WindowsPhone')
-rw-r--r--WindowsPhone/KeyboardTest.suobin50176 -> 51712 bytes
-rw-r--r--WindowsPhone/KeyboardTest/KeyboardTest/Game1.cs13
-rw-r--r--WindowsPhone/Noddybox.Emulation.Xna.Input/Noddybox.Emulation.Xna.Input.csproj3
3 files changed, 12 insertions, 4 deletions
diff --git a/WindowsPhone/KeyboardTest.suo b/WindowsPhone/KeyboardTest.suo
index 2887aa6..bfb7f24 100644
--- a/WindowsPhone/KeyboardTest.suo
+++ b/WindowsPhone/KeyboardTest.suo
Binary files differ
diff --git a/WindowsPhone/KeyboardTest/KeyboardTest/Game1.cs b/WindowsPhone/KeyboardTest/KeyboardTest/Game1.cs
index ccd991c..55d936e 100644
--- a/WindowsPhone/KeyboardTest/KeyboardTest/Game1.cs
+++ b/WindowsPhone/KeyboardTest/KeyboardTest/Game1.cs
@@ -12,6 +12,7 @@ using Microsoft.Xna.Framework.Media;
using Noddybox.Emulation.Xna.Input.Keyboard;
using Noddybox.Emulation.Keyboard.Schema;
using System.IO;
+using Noddybox.Emulation.Xna.Input;
namespace KeyboardTest
{
@@ -40,6 +41,8 @@ namespace KeyboardTest
Key0
}
+ InputManager manager;
+
KeyboardDriver<KeySymbol> keyboard;
public Game1()
@@ -91,10 +94,12 @@ namespace KeyboardTest
def = KeyboardDefinition.Load(stream);
}
- keyboard = new KeyboardDriver<KeySymbol>(graphics.GraphicsDevice, keyboardImage, Vector2.Zero, def);
+ manager = new InputManager();
+
+ keyboard = new KeyboardDriver<KeySymbol>(manager, graphics.GraphicsDevice, keyboardImage, Vector2.Zero, def);
keyboard.KeyEvent += KeyPress;
- keyboard.TouchEvent += Touch;
+ manager.TouchEvent += Touch;
}
/// <summary>
@@ -114,7 +119,7 @@ namespace KeyboardTest
protected override void Update(GameTime gameTime)
{
// TODO: Add your update logic here
- keyboard.Update();
+ manager.Update();
base.Update(gameTime);
}
@@ -149,7 +154,7 @@ namespace KeyboardTest
output.Add(String.Format("{0} - {1}", e.Key.ToString(), e.Pressed.ToString()));
}
- private void Touch(object sender, KeyboardDriver<KeySymbol>.TouchLocationEventArgs e)
+ private void Touch(object sender, InputManager.TouchLocationEventArgs e)
{
if (output.Count > 35)
{
diff --git a/WindowsPhone/Noddybox.Emulation.Xna.Input/Noddybox.Emulation.Xna.Input.csproj b/WindowsPhone/Noddybox.Emulation.Xna.Input/Noddybox.Emulation.Xna.Input.csproj
index 42babf6..8088063 100644
--- a/WindowsPhone/Noddybox.Emulation.Xna.Input/Noddybox.Emulation.Xna.Input.csproj
+++ b/WindowsPhone/Noddybox.Emulation.Xna.Input/Noddybox.Emulation.Xna.Input.csproj
@@ -59,6 +59,9 @@
<Reference Include="System.Net" />
</ItemGroup>
<ItemGroup>
+ <Compile Include="..\..\src\Noddybox.Emulation.Xna.Input\InputManager.cs">
+ <Link>InputManager.cs</Link>
+ </Compile>
<Compile Include="..\..\src\Noddybox.Emulation.Xna.Input\Joystick\JoystickDriver.cs">
<Link>Joystick\JoystickDriver.cs</Link>
</Compile>