From 60b52b009c2f74cea7d5ffb0ad62cbbc55c41729 Mon Sep 17 00:00:00 2001 From: Ian C Date: Sun, 27 May 2012 22:18:17 +0000 Subject: Updated keyboard to chain itself to InputManager. --- WindowsPhone/KeyboardTest/KeyboardTest/Game1.cs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'WindowsPhone/KeyboardTest') 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 keyboard; public Game1() @@ -91,10 +94,12 @@ namespace KeyboardTest def = KeyboardDefinition.Load(stream); } - keyboard = new KeyboardDriver(graphics.GraphicsDevice, keyboardImage, Vector2.Zero, def); + manager = new InputManager(); + + keyboard = new KeyboardDriver(manager, graphics.GraphicsDevice, keyboardImage, Vector2.Zero, def); keyboard.KeyEvent += KeyPress; - keyboard.TouchEvent += Touch; + manager.TouchEvent += Touch; } /// @@ -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.TouchLocationEventArgs e) + private void Touch(object sender, InputManager.TouchLocationEventArgs e) { if (output.Count > 35) { -- cgit v1.2.3