summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan C <ianc@noddybox.co.uk>2012-04-29 23:05:51 +0000
committerIan C <ianc@noddybox.co.uk>2012-04-29 23:05:51 +0000
commite0df170a198f6b875fbbe37a7fa8a3c5fdf3aa5c (patch)
tree19a50de8b19a311b61111ef5d608b2d519f4e753
parent0232442759a7bc0254e1bc2afa852df448f09cb8 (diff)
Adding driver and test project.
-rw-r--r--Native/EmuKeyboardDesigner/EmuKeyboardDesigner.suobin50176 -> 50176 bytes
-rw-r--r--Native/EmuKeyboardDesigner/MainForm.cs21
-rw-r--r--WindowsPhone/KeyboardTest.sln66
-rw-r--r--WindowsPhone/KeyboardTest.suobin0 -> 46592 bytes
-rw-r--r--WindowsPhone/KeyboardTest/KeyboardTest/Background.pngbin0 -> 12776 bytes
-rw-r--r--WindowsPhone/KeyboardTest/KeyboardTest/Game.icobin0 -> 4286 bytes
-rw-r--r--WindowsPhone/KeyboardTest/KeyboardTest/Game1.cs124
-rw-r--r--WindowsPhone/KeyboardTest/KeyboardTest/KeyboardTest.csproj114
-rw-r--r--WindowsPhone/KeyboardTest/KeyboardTest/PhoneGameThumb.pngbin0 -> 3176 bytes
-rw-r--r--WindowsPhone/KeyboardTest/KeyboardTest/Program.cs21
-rw-r--r--WindowsPhone/KeyboardTest/KeyboardTest/Properties/AppManifest.xml6
-rw-r--r--WindowsPhone/KeyboardTest/KeyboardTest/Properties/AssemblyInfo.cs36
-rw-r--r--WindowsPhone/KeyboardTest/KeyboardTest/Properties/WMAppManifest.xml37
-rw-r--r--WindowsPhone/KeyboardTest/KeyboardTest/Spectrum.keyboardbin0 -> 235 bytes
-rw-r--r--WindowsPhone/KeyboardTest/KeyboardTestContent/KeyboardTestContent.contentproj47
-rw-r--r--WindowsPhone/KeyboardTest/KeyboardTestContent/keyboard.pngbin0 -> 114056 bytes
-rw-r--r--WindowsPhone/Noddybox.Emulation.Keyboard.Schema/Noddybox.Emulation.Keyboard.Schema.csproj70
-rw-r--r--WindowsPhone/Noddybox.Emulation.Keyboard.Schema/Properties/AssemblyInfo.cs37
-rw-r--r--WindowsPhone/Noddybox.Emulation.Xna.Keyboard/Noddybox.Emulation.Xna.Keyboard.csproj83
-rw-r--r--WindowsPhone/Noddybox.Emulation.Xna.Keyboard/Properties/AssemblyInfo.cs36
-rw-r--r--src/Noddybox.Emulation.Keyboard.Schema/KeyboardDefinition.cs62
-rw-r--r--src/Noddybox.Emulation.Keyboard.Schema/KeyboardKey.cs61
22 files changed, 743 insertions, 78 deletions
diff --git a/Native/EmuKeyboardDesigner/EmuKeyboardDesigner.suo b/Native/EmuKeyboardDesigner/EmuKeyboardDesigner.suo
index aa47a7d..db01de5 100644
--- a/Native/EmuKeyboardDesigner/EmuKeyboardDesigner.suo
+++ b/Native/EmuKeyboardDesigner/EmuKeyboardDesigner.suo
Binary files differ
diff --git a/Native/EmuKeyboardDesigner/MainForm.cs b/Native/EmuKeyboardDesigner/MainForm.cs
index 36144b9..33ebd22 100644
--- a/Native/EmuKeyboardDesigner/MainForm.cs
+++ b/Native/EmuKeyboardDesigner/MainForm.cs
@@ -86,17 +86,15 @@ namespace EmuKeyboardDesigner
{
OpenFileDialog fsel = new OpenFileDialog();
- fsel.Filter = "XML Files(*.XML)|*.XML";
+ fsel.Filter = "Keyboard Files (*.keyboard)|*.keyboard";
if (fsel.ShowDialog() == DialogResult.OK)
{
try
{
- XmlDocument xml = new XmlDocument();
+ BinaryReader stream = new BinaryReader(File.OpenRead(fsel.FileName), Encoding.UTF8);
- xml.Load(fsel.FileName);
-
- KeyboardDefinition def = KeyboardDefinition.CreateFromXML(xml);
+ KeyboardDefinition def = KeyboardDefinition.Load(stream);
keyList.Items.Clear();
@@ -109,6 +107,9 @@ namespace EmuKeyboardDesigner
{
keyList.SelectedIndex = 0;
}
+
+ stream.Close();
+ stream.Dispose();
}
catch (Exception ex)
{
@@ -121,7 +122,8 @@ namespace EmuKeyboardDesigner
{
SaveFileDialog fsel = new SaveFileDialog();
- fsel.Filter = "XML Files(*.XML)|*.XML";
+ fsel.Filter = "Keyboard Files (*.keyboard)|*.keyboard";
+ fsel.AddExtension = true;
if (fsel.ShowDialog() == DialogResult.OK)
{
@@ -134,9 +136,12 @@ namespace EmuKeyboardDesigner
def.Definitions.Add(k);
}
- XmlDocument doc = def.CreateXML();
+ BinaryWriter stream = new BinaryWriter(File.Create(fsel.FileName), Encoding.UTF8);
+
+ def.Save(stream);
- doc.Save(fsel.FileName);
+ stream.Close();
+ stream.Dispose();
}
catch (Exception ex)
{
diff --git a/WindowsPhone/KeyboardTest.sln b/WindowsPhone/KeyboardTest.sln
new file mode 100644
index 0000000..199f13f
--- /dev/null
+++ b/WindowsPhone/KeyboardTest.sln
@@ -0,0 +1,66 @@
+
+Microsoft Visual Studio Solution File, Format Version 11.00
+# Visual Studio 2010 Express for Windows Phone
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KeyboardTest", "KeyboardTest\KeyboardTest\KeyboardTest.csproj", "{A645334A-FABE-49EF-85EB-5A13871C266D}"
+EndProject
+Project("{96E2B04D-8817-42C6-938A-82C39BA4D311}") = "KeyboardTestContent", "KeyboardTest\KeyboardTestContent\KeyboardTestContent.contentproj", "{6BA269E1-4B99-43F2-A140-3454D78F4D17}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Noddybox.Emulation.Keyboard.Schema", "Noddybox.Emulation.Keyboard.Schema\Noddybox.Emulation.Keyboard.Schema.csproj", "{0F5AA96A-9253-4E06-A3F9-5517A2A9C558}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Noddybox.Emulation.Xna.Keyboard", "Noddybox.Emulation.Xna.Keyboard\Noddybox.Emulation.Xna.Keyboard.csproj", "{3B034AAA-A9FD-4307-95F2-D87BE0A51990}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Debug|Mixed Platforms = Debug|Mixed Platforms
+ Debug|Windows Phone = Debug|Windows Phone
+ Release|Any CPU = Release|Any CPU
+ Release|Mixed Platforms = Release|Mixed Platforms
+ Release|Windows Phone = Release|Windows Phone
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {A645334A-FABE-49EF-85EB-5A13871C266D}.Debug|Any CPU.ActiveCfg = Debug|Windows Phone
+ {A645334A-FABE-49EF-85EB-5A13871C266D}.Debug|Mixed Platforms.ActiveCfg = Debug|Windows Phone
+ {A645334A-FABE-49EF-85EB-5A13871C266D}.Debug|Mixed Platforms.Build.0 = Debug|Windows Phone
+ {A645334A-FABE-49EF-85EB-5A13871C266D}.Debug|Mixed Platforms.Deploy.0 = Debug|Windows Phone
+ {A645334A-FABE-49EF-85EB-5A13871C266D}.Debug|Windows Phone.ActiveCfg = Debug|Windows Phone
+ {A645334A-FABE-49EF-85EB-5A13871C266D}.Debug|Windows Phone.Build.0 = Debug|Windows Phone
+ {A645334A-FABE-49EF-85EB-5A13871C266D}.Debug|Windows Phone.Deploy.0 = Debug|Windows Phone
+ {A645334A-FABE-49EF-85EB-5A13871C266D}.Release|Any CPU.ActiveCfg = Release|Windows Phone
+ {A645334A-FABE-49EF-85EB-5A13871C266D}.Release|Mixed Platforms.ActiveCfg = Release|Windows Phone
+ {A645334A-FABE-49EF-85EB-5A13871C266D}.Release|Mixed Platforms.Build.0 = Release|Windows Phone
+ {A645334A-FABE-49EF-85EB-5A13871C266D}.Release|Mixed Platforms.Deploy.0 = Release|Windows Phone
+ {A645334A-FABE-49EF-85EB-5A13871C266D}.Release|Windows Phone.ActiveCfg = Release|Windows Phone
+ {A645334A-FABE-49EF-85EB-5A13871C266D}.Release|Windows Phone.Build.0 = Release|Windows Phone
+ {A645334A-FABE-49EF-85EB-5A13871C266D}.Release|Windows Phone.Deploy.0 = Release|Windows Phone
+ {6BA269E1-4B99-43F2-A140-3454D78F4D17}.Debug|Any CPU.ActiveCfg = Debug|Windows Phone
+ {6BA269E1-4B99-43F2-A140-3454D78F4D17}.Debug|Mixed Platforms.ActiveCfg = Debug|Windows Phone
+ {6BA269E1-4B99-43F2-A140-3454D78F4D17}.Debug|Windows Phone.ActiveCfg = Debug|Windows Phone
+ {6BA269E1-4B99-43F2-A140-3454D78F4D17}.Release|Any CPU.ActiveCfg = Release|Windows Phone
+ {6BA269E1-4B99-43F2-A140-3454D78F4D17}.Release|Mixed Platforms.ActiveCfg = Release|Windows Phone
+ {6BA269E1-4B99-43F2-A140-3454D78F4D17}.Release|Windows Phone.ActiveCfg = Release|Windows Phone
+ {0F5AA96A-9253-4E06-A3F9-5517A2A9C558}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {0F5AA96A-9253-4E06-A3F9-5517A2A9C558}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {0F5AA96A-9253-4E06-A3F9-5517A2A9C558}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
+ {0F5AA96A-9253-4E06-A3F9-5517A2A9C558}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
+ {0F5AA96A-9253-4E06-A3F9-5517A2A9C558}.Debug|Windows Phone.ActiveCfg = Debug|Any CPU
+ {0F5AA96A-9253-4E06-A3F9-5517A2A9C558}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {0F5AA96A-9253-4E06-A3F9-5517A2A9C558}.Release|Any CPU.Build.0 = Release|Any CPU
+ {0F5AA96A-9253-4E06-A3F9-5517A2A9C558}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
+ {0F5AA96A-9253-4E06-A3F9-5517A2A9C558}.Release|Mixed Platforms.Build.0 = Release|Any CPU
+ {0F5AA96A-9253-4E06-A3F9-5517A2A9C558}.Release|Windows Phone.ActiveCfg = Release|Any CPU
+ {3B034AAA-A9FD-4307-95F2-D87BE0A51990}.Debug|Any CPU.ActiveCfg = Debug|Windows Phone
+ {3B034AAA-A9FD-4307-95F2-D87BE0A51990}.Debug|Mixed Platforms.ActiveCfg = Debug|Windows Phone
+ {3B034AAA-A9FD-4307-95F2-D87BE0A51990}.Debug|Mixed Platforms.Build.0 = Debug|Windows Phone
+ {3B034AAA-A9FD-4307-95F2-D87BE0A51990}.Debug|Windows Phone.ActiveCfg = Debug|Windows Phone
+ {3B034AAA-A9FD-4307-95F2-D87BE0A51990}.Debug|Windows Phone.Build.0 = Debug|Windows Phone
+ {3B034AAA-A9FD-4307-95F2-D87BE0A51990}.Release|Any CPU.ActiveCfg = Release|Windows Phone
+ {3B034AAA-A9FD-4307-95F2-D87BE0A51990}.Release|Mixed Platforms.ActiveCfg = Release|Windows Phone
+ {3B034AAA-A9FD-4307-95F2-D87BE0A51990}.Release|Mixed Platforms.Build.0 = Release|Windows Phone
+ {3B034AAA-A9FD-4307-95F2-D87BE0A51990}.Release|Windows Phone.ActiveCfg = Release|Windows Phone
+ {3B034AAA-A9FD-4307-95F2-D87BE0A51990}.Release|Windows Phone.Build.0 = Release|Windows Phone
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/WindowsPhone/KeyboardTest.suo b/WindowsPhone/KeyboardTest.suo
new file mode 100644
index 0000000..9205510
--- /dev/null
+++ b/WindowsPhone/KeyboardTest.suo
Binary files differ
diff --git a/WindowsPhone/KeyboardTest/KeyboardTest/Background.png b/WindowsPhone/KeyboardTest/KeyboardTest/Background.png
new file mode 100644
index 0000000..4af7a5f
--- /dev/null
+++ b/WindowsPhone/KeyboardTest/KeyboardTest/Background.png
Binary files differ
diff --git a/WindowsPhone/KeyboardTest/KeyboardTest/Game.ico b/WindowsPhone/KeyboardTest/KeyboardTest/Game.ico
new file mode 100644
index 0000000..8cff41e
--- /dev/null
+++ b/WindowsPhone/KeyboardTest/KeyboardTest/Game.ico
Binary files differ
diff --git a/WindowsPhone/KeyboardTest/KeyboardTest/Game1.cs b/WindowsPhone/KeyboardTest/KeyboardTest/Game1.cs
new file mode 100644
index 0000000..e5af385
--- /dev/null
+++ b/WindowsPhone/KeyboardTest/KeyboardTest/Game1.cs
@@ -0,0 +1,124 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using Microsoft.Xna.Framework;
+using Microsoft.Xna.Framework.Audio;
+using Microsoft.Xna.Framework.Content;
+using Microsoft.Xna.Framework.GamerServices;
+using Microsoft.Xna.Framework.Graphics;
+using Microsoft.Xna.Framework.Input;
+using Microsoft.Xna.Framework.Input.Touch;
+using Microsoft.Xna.Framework.Media;
+using Noddybox.Emulation.Xna.Keyboard;
+using Noddybox.Emulation.Keyboard.Schema;
+using System.IO;
+
+namespace KeyboardTest
+{
+ /// <summary>
+ /// This is the main type for your game
+ /// </summary>
+ public class Game1 : Microsoft.Xna.Framework.Game
+ {
+ GraphicsDeviceManager graphics;
+ SpriteBatch spriteBatch;
+ Texture2D keyboardImage;
+
+ public enum KeySymbol
+ {
+ Key1,
+ Key2,
+ Key3,
+ Key4,
+ Key5,
+ Key6,
+ Key7,
+ Key8,
+ Key9,
+ Key0
+ }
+
+ KeyboardDriver<KeySymbol> keyboard;
+
+ public Game1()
+ {
+ graphics = new GraphicsDeviceManager(this);
+ graphics.SupportedOrientations = DisplayOrientation.Portrait;
+
+ Content.RootDirectory = "Content";
+
+ // Frame rate is 30 fps by default for Windows Phone.
+ TargetElapsedTime = TimeSpan.FromTicks(333333);
+
+ // Extend battery life under lock.
+ InactiveSleepTime = TimeSpan.FromSeconds(1);
+ }
+
+ /// <summary>
+ /// Allows the game to perform any initialization it needs to before starting to run.
+ /// This is where it can query for any required services and load any non-graphic
+ /// related content. Calling base.Initialize will enumerate through any components
+ /// and initialize them as well.
+ /// </summary>
+ protected override void Initialize()
+ {
+ // TODO: Add your initialization logic here
+
+ base.Initialize();
+ }
+
+ /// <summary>
+ /// LoadContent will be called once per game and is the place to load
+ /// all of your content.
+ /// </summary>
+ protected override void LoadContent()
+ {
+ // Create a new SpriteBatch, which can be used to draw textures.
+ spriteBatch = new SpriteBatch(GraphicsDevice);
+
+ keyboardImage = Content.Load<Texture2D>("keyboard");
+
+ KeyboardDefinition def;
+
+ using (BinaryReader stream = new BinaryReader(TitleContainer.OpenStream(@"Spectrum.keyboard")))
+ {
+ def = KeyboardDefinition.Load(stream);
+ }
+
+ keyboard = new KeyboardDriver<KeySymbol>(keyboardImage, Vector2.Zero, def);
+ }
+
+ /// <summary>
+ /// UnloadContent will be called once per game and is the place to unload
+ /// all content.
+ /// </summary>
+ protected override void UnloadContent()
+ {
+ // TODO: Unload any non ContentManager content here
+ }
+
+ /// <summary>
+ /// Allows the game to run logic such as updating the world,
+ /// checking for collisions, gathering input, and playing audio.
+ /// </summary>
+ /// <param name="gameTime">Provides a snapshot of timing values.</param>
+ protected override void Update(GameTime gameTime)
+ {
+ // TODO: Add your update logic here
+
+ base.Update(gameTime);
+ }
+
+ /// <summary>
+ /// This is called when the game should draw itself.
+ /// </summary>
+ /// <param name="gameTime">Provides a snapshot of timing values.</param>
+ protected override void Draw(GameTime gameTime)
+ {
+ graphics.GraphicsDevice.Clear(Color.PaleVioletRed);
+ spriteBatch.Begin();
+ keyboard.Draw(spriteBatch);
+ spriteBatch.End();
+ }
+ }
+}
diff --git a/WindowsPhone/KeyboardTest/KeyboardTest/KeyboardTest.csproj b/WindowsPhone/KeyboardTest/KeyboardTest/KeyboardTest.csproj
new file mode 100644
index 0000000..fedeed5
--- /dev/null
+++ b/WindowsPhone/KeyboardTest/KeyboardTest/KeyboardTest.csproj
@@ -0,0 +1,114 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <ProjectGuid>{A645334A-FABE-49EF-85EB-5A13871C266D}</ProjectGuid>
+ <ProjectTypeGuids>{6D335F3A-9D43-41b4-9D22-F6F17C4BE596};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">Windows Phone</Platform>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>KeyboardTest</RootNamespace>
+ <AssemblyName>KeyboardTest</AssemblyName>
+ <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+ <TargetFrameworkProfile>Client</TargetFrameworkProfile>
+ <XnaFrameworkVersion>v4.0</XnaFrameworkVersion>
+ <XnaPlatform>Windows Phone</XnaPlatform>
+ <XnaProfile>Reach</XnaProfile>
+ <XnaCrossPlatformGroupID>dce4fe6e-26f4-43cf-971c-31f6e78066c4</XnaCrossPlatformGroupID>
+ <XnaOutputType>Game</XnaOutputType>
+ <XnaRefreshLevel>1</XnaRefreshLevel>
+ <WPTombstoneEnabled>false</WPTombstoneEnabled>
+ <XapFilename>$(AssemblyName).xap</XapFilename>
+ <SilverlightManifestTemplate>Properties\AppManifest.xml</SilverlightManifestTemplate>
+ <XnaWindowsPhoneManifestTemplate>Properties\WMAppManifest.xml</XnaWindowsPhoneManifestTemplate>
+ <TileImage>Background.png</TileImage>
+ <TileTitle>KeyboardTest</TileTitle>
+ <SupportedCultures>
+ </SupportedCultures>
+ <ApplicationIcon>Game.ico</ApplicationIcon>
+ <Thumbnail>PhoneGameThumb.png</Thumbnail>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|Windows Phone' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Windows Phone\Debug</OutputPath>
+ <DefineConstants>DEBUG;TRACE;WINDOWS_PHONE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <NoStdLib>true</NoStdLib>
+ <UseVSHostingProcess>false</UseVSHostingProcess>
+ <XnaCompressContent>false</XnaCompressContent>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|Windows Phone' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Windows Phone\Release</OutputPath>
+ <DefineConstants>TRACE;WINDOWS_PHONE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <NoStdLib>true</NoStdLib>
+ <UseVSHostingProcess>false</UseVSHostingProcess>
+ <XnaCompressContent>false</XnaCompressContent>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="Microsoft.Xna.Framework" />
+ <Reference Include="Microsoft.Xna.Framework.Game" />
+ <Reference Include="Microsoft.Xna.Framework.Graphics" />
+ <Reference Include="Microsoft.Xna.Framework.GamerServices" />
+ <Reference Include="Microsoft.Xna.Framework.Input.Touch" />
+ <Reference Include="mscorlib" />
+ <Reference Include="System" />
+ <Reference Include="System.Xml" />
+ <Reference Include="System.Core" />
+ <Reference Include="System.Xml.Linq" />
+ <Reference Include="System.Net" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ <None Include="Properties\AppManifest.xml">
+ <XnaPlatformSpecific>true</XnaPlatformSpecific>
+ </None>
+ <None Include="Properties\WMAppManifest.xml">
+ <XnaPlatformSpecific>true</XnaPlatformSpecific>
+ </None>
+ <Compile Include="Program.cs" />
+ <Compile Include="Game1.cs" />
+ <None Include="Spectrum.keyboard">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
+ </ItemGroup>
+ <ItemGroup>
+ <Content Include="Game.ico" />
+ <Content Include="PhoneGameThumb.png">
+ <XnaPlatformSpecific>true</XnaPlatformSpecific>
+ </Content>
+ <Content Include="Background.png">
+ <XnaPlatformSpecific>true</XnaPlatformSpecific>
+ </Content>
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\..\Noddybox.Emulation.Keyboard.Schema\Noddybox.Emulation.Keyboard.Schema.csproj">
+ <Project>{0F5AA96A-9253-4E06-A3F9-5517A2A9C558}</Project>
+ <Name>Noddybox.Emulation.Keyboard.Schema</Name>
+ </ProjectReference>
+ <ProjectReference Include="..\..\Noddybox.Emulation.Xna.Keyboard\Noddybox.Emulation.Xna.Keyboard.csproj">
+ <Project>{3B034AAA-A9FD-4307-95F2-D87BE0A51990}</Project>
+ <Name>Noddybox.Emulation.Xna.Keyboard</Name>
+ </ProjectReference>
+ <ProjectReference Include="..\KeyboardTestContent\KeyboardTestContent.contentproj">
+ <Name>KeyboardTestContent</Name>
+ <XnaReferenceType>Content</XnaReferenceType>
+ </ProjectReference>
+ </ItemGroup>
+ <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+ <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\Microsoft.Xna.GameStudio.targets" />
+ <!--
+ To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+</Project> \ No newline at end of file
diff --git a/WindowsPhone/KeyboardTest/KeyboardTest/PhoneGameThumb.png b/WindowsPhone/KeyboardTest/KeyboardTest/PhoneGameThumb.png
new file mode 100644
index 0000000..a45f4db
--- /dev/null
+++ b/WindowsPhone/KeyboardTest/KeyboardTest/PhoneGameThumb.png
Binary files differ
diff --git a/WindowsPhone/KeyboardTest/KeyboardTest/Program.cs b/WindowsPhone/KeyboardTest/KeyboardTest/Program.cs
new file mode 100644
index 0000000..66a93da
--- /dev/null
+++ b/WindowsPhone/KeyboardTest/KeyboardTest/Program.cs
@@ -0,0 +1,21 @@
+using System;
+
+namespace KeyboardTest
+{
+#if WINDOWS || XBOX
+ static class Program
+ {
+ /// <summary>
+ /// The main entry point for the application.
+ /// </summary>
+ static void Main(string[] args)
+ {
+ using (Game1 game = new Game1())
+ {
+ game.Run();
+ }
+ }
+ }
+#endif
+}
+
diff --git a/WindowsPhone/KeyboardTest/KeyboardTest/Properties/AppManifest.xml b/WindowsPhone/KeyboardTest/KeyboardTest/Properties/AppManifest.xml
new file mode 100644
index 0000000..a955232
--- /dev/null
+++ b/WindowsPhone/KeyboardTest/KeyboardTest/Properties/AppManifest.xml
@@ -0,0 +1,6 @@
+<Deployment xmlns="http://schemas.microsoft.com/client/2007/deployment"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+>
+ <Deployment.Parts>
+ </Deployment.Parts>
+</Deployment>
diff --git a/WindowsPhone/KeyboardTest/KeyboardTest/Properties/AssemblyInfo.cs b/WindowsPhone/KeyboardTest/KeyboardTest/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..505e65f
--- /dev/null
+++ b/WindowsPhone/KeyboardTest/KeyboardTest/Properties/AssemblyInfo.cs
@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using System.Resources;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("KeyboardTest")]
+[assembly: AssemblyProduct("KeyboardTest")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyCopyright("Copyright © 2012")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type. Only Windows
+// assemblies support COM.
+[assembly: ComVisible(false)]
+
+// On Windows, the following GUID is for the ID of the typelib if this
+// project is exposed to COM. On other platforms, it unique identifies the
+// title storage container when deploying this assembly to the device.
+[assembly: Guid("a8941355-2750-4e06-9666-7861504db51c")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: NeutralResourcesLanguageAttribute("en-US")] \ No newline at end of file
diff --git a/WindowsPhone/KeyboardTest/KeyboardTest/Properties/WMAppManifest.xml b/WindowsPhone/KeyboardTest/KeyboardTest/Properties/WMAppManifest.xml
new file mode 100644
index 0000000..0b6b828
--- /dev/null
+++ b/WindowsPhone/KeyboardTest/KeyboardTest/Properties/WMAppManifest.xml
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<Deployment xmlns="http://schemas.microsoft.com/windowsphone/2009/deployment" AppPlatformVersion="7.1">
+ <App xmlns="" ProductID="{a8941355-2750-4e06-9666-7861504db51c}" Title="KeyboardTest" RuntimeType="XNA" Version="1.0.0.0" Genre="Apps.Normal" Author="" Description="" Publisher="">
+ <IconPath IsRelative="true" IsResource="false"></IconPath>
+ <Capabilities>
+ <Capability Name="ID_CAP_NETWORKING" />
+ <Capability Name="ID_CAP_LOCATION" />
+ <Capability Name="ID_CAP_SENSORS" />
+ <Capability Name="ID_CAP_MICROPHONE" />
+ <Capability Name="ID_CAP_MEDIALIB" />
+ <Capability Name="ID_CAP_GAMERSERVICES" />
+ <Capability Name="ID_CAP_PHONEDIALER" />
+ <Capability Name="ID_CAP_PUSH_NOTIFICATION" />
+ <Capability Name="ID_CAP_WEBBROWSERCOMPONENT" />
+ <Capability Name="ID_CAP_IDENTITY_USER" />
+ <Capability Name="ID_CAP_IDENTITY_DEVICE" />
+
+ <!-- Windows Phone OS 7.1 Capabilities -->
+ <Capability Name="ID_CAP_ISV_CAMERA" />
+ <Capability Name="ID_CAP_CONTACTS" />
+ <Capability Name="ID_CAP_APPOINTMENTS" />
+ </Capabilities>
+ <Tasks>
+ <DefaultTask Name="_default"/>
+ </Tasks>
+ <Tokens>
+ <PrimaryToken TokenID="KeyboardTestToken" TaskName="_default">
+ <TemplateType5>
+ <BackgroundImageURI IsRelative="true" IsResource="false"></BackgroundImageURI>
+ <Count>0</Count>
+ <Title></Title>
+ </TemplateType5>
+ </PrimaryToken>
+ </Tokens>
+ </App>
+</Deployment>
+
diff --git a/WindowsPhone/KeyboardTest/KeyboardTest/Spectrum.keyboard b/WindowsPhone/KeyboardTest/KeyboardTest/Spectrum.keyboard
new file mode 100644
index 0000000..2607d6c
--- /dev/null
+++ b/WindowsPhone/KeyboardTest/KeyboardTest/Spectrum.keyboard
Binary files differ
diff --git a/WindowsPhone/KeyboardTest/KeyboardTestContent/KeyboardTestContent.contentproj b/WindowsPhone/KeyboardTest/KeyboardTestContent/KeyboardTestContent.contentproj
new file mode 100644
index 0000000..3ed205e
--- /dev/null
+++ b/WindowsPhone/KeyboardTest/KeyboardTestContent/KeyboardTestContent.contentproj
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <ProjectGuid>{6BA269E1-4B99-43F2-A140-3454D78F4D17}</ProjectGuid>
+ <ProjectTypeGuids>{96E2B04D-8817-42c6-938A-82C39BA4D311};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+ <XnaFrameworkVersion>v4.0</XnaFrameworkVersion>
+ <OutputPath>bin\$(Platform)\$(Configuration)</OutputPath>
+ <ContentRootDirectory>Content</ContentRootDirectory>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|Windows Phone'">
+ <PlatformTarget>x86</PlatformTarget>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|Windows Phone'">
+ <PlatformTarget>x86</PlatformTarget>
+ </PropertyGroup>
+ <PropertyGroup>
+ <RootNamespace>KeyboardTestContent</RootNamespace>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="Microsoft.Xna.Framework.Content.Pipeline.EffectImporter, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=MSIL" />
+ <Reference Include="Microsoft.Xna.Framework.Content.Pipeline.FBXImporter, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=MSIL" />
+ <Reference Include="Microsoft.Xna.Framework.Content.Pipeline.TextureImporter, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=MSIL" />
+ <Reference Include="Microsoft.Xna.Framework.Content.Pipeline.XImporter, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=MSIL" />
+ <Reference Include="Microsoft.Xna.Framework.Content.Pipeline.AudioImporters, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=MSIL" />
+ <Reference Include="Microsoft.Xna.Framework.Content.Pipeline.VideoImporters, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=MSIL" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="keyboard.png">
+ <Name>keyboard</Name>
+ <Importer>TextureImporter</Importer>
+ <Processor>TextureProcessor</Processor>
+ </Compile>
+ </ItemGroup>
+ <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" />
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+</Project> \ No newline at end of file
diff --git a/WindowsPhone/KeyboardTest/KeyboardTestContent/keyboard.png b/WindowsPhone/KeyboardTest/KeyboardTestContent/keyboard.png
new file mode 100644
index 0000000..a607364
--- /dev/null
+++ b/WindowsPhone/KeyboardTest/KeyboardTestContent/keyboard.png
Binary files differ
diff --git a/WindowsPhone/Noddybox.Emulation.Keyboard.Schema/Noddybox.Emulation.Keyboard.Schema.csproj b/WindowsPhone/Noddybox.Emulation.Keyboard.Schema/Noddybox.Emulation.Keyboard.Schema.csproj
new file mode 100644
index 0000000..3ba4e63
--- /dev/null
+++ b/WindowsPhone/Noddybox.Emulation.Keyboard.Schema/Noddybox.Emulation.Keyboard.Schema.csproj
@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>10.0.20506</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{0F5AA96A-9253-4E06-A3F9-5517A2A9C558}</ProjectGuid>
+ <ProjectTypeGuids>{C089C8C0-30E0-4E22-80C0-CE093F111A43};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>Noddybox.Emulation.Keyboard.Schema</RootNamespace>
+ <AssemblyName>Noddybox.Emulation.Keyboard.Schema</AssemblyName>
+ <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+ <SilverlightVersion>$(TargetFrameworkVersion)</SilverlightVersion>
+ <TargetFrameworkProfile>WindowsPhone71</TargetFrameworkProfile>
+ <TargetFrameworkIdentifier>Silverlight</TargetFrameworkIdentifier>
+ <SilverlightApplication>false</SilverlightApplication>
+ <ValidateXaml>true</ValidateXaml>
+ <ThrowErrorsInValidation>true</ThrowErrorsInValidation>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>Bin\Debug</OutputPath>
+ <DefineConstants>DEBUG;TRACE;SILVERLIGHT;WINDOWS_PHONE</DefineConstants>
+ <NoStdLib>true</NoStdLib>
+ <NoConfig>true</NoConfig>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>Bin\Release</OutputPath>
+ <DefineConstants>TRACE;SILVERLIGHT;WINDOWS_PHONE</DefineConstants>
+ <NoStdLib>true</NoStdLib>
+ <NoConfig>true</NoConfig>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="System.Windows" />
+ <Reference Include="system" />
+ <Reference Include="System.Core" />
+ <Reference Include="System.Xml" />
+ <Reference Include="System.Net" />
+ <Reference Include="mscorlib.extensions" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="..\..\src\Noddybox.Emulation.Keyboard.Schema\KeyboardDefinition.cs">
+ <Link>KeyboardDefinition.cs</Link>
+ </Compile>
+ <Compile Include="..\..\src\Noddybox.Emulation.Keyboard.Schema\KeyboardKey.cs">
+ <Link>KeyboardKey.cs</Link>
+ </Compile>
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ </ItemGroup>
+ <Import Project="$(MSBuildExtensionsPath)\Microsoft\Silverlight for Phone\$(TargetFrameworkVersion)\Microsoft.Silverlight.$(TargetFrameworkProfile).Overrides.targets" />
+ <Import Project="$(MSBuildExtensionsPath)\Microsoft\Silverlight for Phone\$(TargetFrameworkVersion)\Microsoft.Silverlight.CSharp.targets" />
+ <ProjectExtensions />
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+</Project> \ No newline at end of file
diff --git a/WindowsPhone/Noddybox.Emulation.Keyboard.Schema/Properties/AssemblyInfo.cs b/WindowsPhone/Noddybox.Emulation.Keyboard.Schema/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..defbfae
--- /dev/null
+++ b/WindowsPhone/Noddybox.Emulation.Keyboard.Schema/Properties/AssemblyInfo.cs
@@ -0,0 +1,37 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using System.Resources;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("Noddybox.Emulation.Keyboard.Schema")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("Noddybox.Emulation.Keyboard.Schema")]
+[assembly: AssemblyCopyright("Copyright © 2012")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("5a9db641-2d92-4b2e-b125-79ab0bbb44c9")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Revision and Build Numbers
+// by using the '*' as shown below:
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
+[assembly: NeutralResourcesLanguageAttribute("en-US")]
diff --git a/WindowsPhone/Noddybox.Emulation.Xna.Keyboard/Noddybox.Emulation.Xna.Keyboard.csproj b/WindowsPhone/Noddybox.Emulation.Xna.Keyboard/Noddybox.Emulation.Xna.Keyboard.csproj
new file mode 100644
index 0000000..92eefd7
--- /dev/null
+++ b/WindowsPhone/Noddybox.Emulation.Xna.Keyboard/Noddybox.Emulation.Xna.Keyboard.csproj
@@ -0,0 +1,83 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <ProjectGuid>{3B034AAA-A9FD-4307-95F2-D87BE0A51990}</ProjectGuid>
+ <ProjectTypeGuids>{6D335F3A-9D43-41b4-9D22-F6F17C4BE596};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">Windows Phone</Platform>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>Noddybox.Emulation.Xna.Keyboard</RootNamespace>
+ <AssemblyName>Noddybox.Emulation.Xna.Keyboard</AssemblyName>
+ <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+ <TargetFrameworkProfile>Client</TargetFrameworkProfile>
+ <XnaFrameworkVersion>v4.0</XnaFrameworkVersion>
+ <XnaPlatform>Windows Phone</XnaPlatform>
+ <XnaProfile>Reach</XnaProfile>
+ <XnaCrossPlatformGroupID>2f332963-aa65-41d2-a897-d8dba47bb8f4</XnaCrossPlatformGroupID>
+ <XnaOutputType>Library</XnaOutputType>
+ <XnaRefreshLevel>1</XnaRefreshLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|Windows Phone' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Windows Phone\Debug</OutputPath>
+ <DefineConstants>DEBUG;TRACE;WINDOWS_PHONE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <NoStdLib>true</NoStdLib>
+ <UseVSHostingProcess>false</UseVSHostingProcess>
+ <XnaCompressContent>false</XnaCompressContent>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|Windows Phone' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Windows Phone\Release</OutputPath>
+ <DefineConstants>TRACE;WINDOWS_PHONE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <NoStdLib>true</NoStdLib>
+ <UseVSHostingProcess>false</UseVSHostingProcess>
+ <XnaCompressContent>false</XnaCompressContent>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="Microsoft.Xna.Framework" />
+ <Reference Include="Microsoft.Xna.Framework.Game" />
+ <Reference Include="Microsoft.Xna.Framework.Graphics" />
+ <Reference Include="Microsoft.Xna.Framework.GamerServices" />
+ <Reference Include="Microsoft.Xna.Framework.Input.Touch" />
+ <Reference Include="mscorlib" />
+ <Reference Include="System" />
+ <Reference Include="System.Xml" />
+ <Reference Include="System.Core">
+ <RequiredTargetFramework>4.0</RequiredTargetFramework>
+ </Reference>
+ <Reference Include="System.Xml.Linq">
+ <RequiredTargetFramework>4.0</RequiredTargetFramework>
+ </Reference>
+ <Reference Include="System.Net" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="..\..\src\Noddybox.Emulation.Xna.Keyboard\KeyboardDriver.cs">
+ <Link>KeyboardDriver.cs</Link>
+ </Compile>
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\Noddybox.Emulation.Keyboard.Schema\Noddybox.Emulation.Keyboard.Schema.csproj">
+ <Project>{0F5AA96A-9253-4E06-A3F9-5517A2A9C558}</Project>
+ <Name>Noddybox.Emulation.Keyboard.Schema</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+ <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\Microsoft.Xna.GameStudio.targets" />
+ <!--
+ To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+</Project> \ No newline at end of file
diff --git a/WindowsPhone/Noddybox.Emulation.Xna.Keyboard/Properties/AssemblyInfo.cs b/WindowsPhone/Noddybox.Emulation.Xna.Keyboard/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..6579f5a
--- /dev/null
+++ b/WindowsPhone/Noddybox.Emulation.Xna.Keyboard/Properties/AssemblyInfo.cs
@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using System.Resources;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("Noddybox.Emulation.Xna.Keyboard")]
+[assembly: AssemblyProduct("Noddybox.Emulation.Xna.Keyboard")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyCopyright("Copyright © 2012")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type. Only Windows
+// assemblies support COM.
+[assembly: ComVisible(false)]
+
+// On Windows, the following GUID is for the ID of the typelib if this
+// project is exposed to COM. On other platforms, it unique identifies the
+// title storage container when deploying this assembly to the device.
+[assembly: Guid("c95f04eb-9a91-4c45-8b47-9a60b904e7f3")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: NeutralResourcesLanguageAttribute("en-US")] \ No newline at end of file
diff --git a/src/Noddybox.Emulation.Keyboard.Schema/KeyboardDefinition.cs b/src/Noddybox.Emulation.Keyboard.Schema/KeyboardDefinition.cs
index 5ca3f47..10a1c51 100644
--- a/src/Noddybox.Emulation.Keyboard.Schema/KeyboardDefinition.cs
+++ b/src/Noddybox.Emulation.Keyboard.Schema/KeyboardDefinition.cs
@@ -16,7 +16,7 @@
// Copyright (c) 2012 Ian Cowburn
//
using System;
-using System.Xml;
+using System.IO;
using System.Collections.Generic;
namespace Noddybox.Emulation.Keyboard.Schema
@@ -26,6 +26,12 @@ namespace Noddybox.Emulation.Keyboard.Schema
/// </summary>
public class KeyboardDefinition
{
+ #region Version
+
+ private const string magic = "KEYBDEF1.0";
+
+ #endregion
+
#region Properties
/// <summary>
@@ -35,57 +41,45 @@ namespace Noddybox.Emulation.Keyboard.Schema
#endregion
- #region Xml functions
+ #region Load/Save
/// <summary>
- /// Create the XML for this keyboard definition.
+ /// Save this keybaord definition to the stream.
/// </summary>
- /// <returns>The created XML document.</returns>
- public XmlDocument CreateXML()
+ /// <param name="stream">The stream to write to.</param>
+ public void Save(BinaryWriter stream)
{
- XmlDocument doc = new XmlDocument();
-
- doc.AppendChild(doc.CreateXmlDeclaration("1.0", null, null));
- doc.AppendChild(doc.CreateElement("Keyboard"));
-
+ stream.Write(magic);
+ stream.Write(Definitions.Count);
+
foreach (KeyboardKey k in Definitions)
{
- XmlElement e = doc.CreateElement("Key");
- k.SetElement(e);
- doc.DocumentElement.AppendChild(e);
+ k.Save(stream);
}
-
- return doc;
}
/// <summary>
- /// Create an object from XML.
+ /// Load a keyboard definition from the passed stream.
/// </summary>
- /// <param name="doc">The XML document to load from.</param>
- /// <returns>The created object.</returns>
- public static KeyboardDefinition CreateFromXML(XmlDocument doc)
+ /// <param name="stream">The stream to read from.</param>
+ /// <returns>The KeyboardDefinition object.</returns>
+ public static KeyboardDefinition Load(BinaryReader stream)
{
- KeyboardDefinition definition = new KeyboardDefinition();
-
- if (doc.DocumentElement.Name != "Keyboard")
+ if (stream.ReadString() != magic)
{
- throw new ArgumentException("Root element not a keyboard");
+ throw new ArgumentException("Stream has wrong magic");
}
- foreach (XmlNode n in doc.DocumentElement.ChildNodes)
+ KeyboardDefinition keyboard = new KeyboardDefinition();
+
+ int count = stream.ReadInt32();
+
+ for(int f = 0; f < count ; f++)
{
- if (n is XmlElement)
- {
- XmlElement e = (XmlElement)n;
-
- if (e.Name == "Key")
- {
- definition.Definitions.Add(KeyboardKey.CreateFromElement(e));
- }
- }
+ keyboard.Definitions.Add(KeyboardKey.Load(stream));
}
- return definition;
+ return keyboard;
}
#endregion
diff --git a/src/Noddybox.Emulation.Keyboard.Schema/KeyboardKey.cs b/src/Noddybox.Emulation.Keyboard.Schema/KeyboardKey.cs
index 6dac9b1..501fd2f 100644
--- a/src/Noddybox.Emulation.Keyboard.Schema/KeyboardKey.cs
+++ b/src/Noddybox.Emulation.Keyboard.Schema/KeyboardKey.cs
@@ -16,7 +16,7 @@
// Copyright (c) 2012 Ian Cowburn
//
using System;
-using System.Xml;
+using System.IO;
namespace Noddybox.Emulation.Keyboard.Schema
{
@@ -61,50 +61,39 @@ namespace Noddybox.Emulation.Keyboard.Schema
#endregion
- #region Xml members
+ #region Load/Save
/// <summary>
- /// Set up an XmlElement with the contents of this object.
+ /// Save this object to a stream.
/// </summary>
- /// <param name="doc">The document the element is to be attached to.</param>
- public void SetElement(XmlElement element)
+ /// <param name="stream">The stream to write to.</param>
+ public void Save(BinaryWriter stream)
{
- element.SetAttribute("KeySymbol", KeySymbol);
- element.SetAttribute("X", X.ToString());
- element.SetAttribute("Y", Y.ToString());
- element.SetAttribute("Width", Width.ToString());
- element.SetAttribute("Height", Height.ToString());
- element.SetAttribute("Sticky", Sticky.ToString());
+ stream.Write(KeySymbol);
+ stream.Write(X);
+ stream.Write(Y);
+ stream.Write(Width);
+ stream.Write(Height);
+ stream.Write(Sticky);
}
/// <summary>
- /// Create an instance of this object from an XmlElement.
+ /// Create an instance of this object from a stream.
/// </summary>
- /// <param name="doc">The document the element is to be attached to.</param>
- /// <returns>The XML element.</returns>
- public static KeyboardKey CreateFromElement(XmlElement element)
+ /// <param name="stream">The stream to read from.</param>
+ /// <returns>The KeyboardKey object.</returns>
+ public static KeyboardKey Load(BinaryReader stream)
{
- XmlAttribute symbol = element.Attributes["KeySymbol"];
- XmlAttribute x = element.Attributes["X"];
- XmlAttribute y = element.Attributes["Y"];
- XmlAttribute width = element.Attributes["Width"];
- XmlAttribute height = element.Attributes["Height"];
- XmlAttribute sticky = element.Attributes["Sticky"];
-
- if (symbol == null || x == null || y == null || width == null || height == null || sticky == null)
- {
- throw new ArgumentException("Element does not contain expected attributes");
- }
-
- return new KeyboardKey()
- {
- KeySymbol = symbol.Value,
- X = Convert.ToInt32(x.Value),
- Y = Convert.ToInt32(y.Value),
- Width = Convert.ToInt32(width.Value),
- Height = Convert.ToInt32(height.Value),
- Sticky = Convert.ToBoolean(sticky.Value)
- };
+ KeyboardKey key = new KeyboardKey();
+
+ key.KeySymbol = stream.ReadString();
+ key.X = stream.ReadInt32();
+ key.Y = stream.ReadInt32();
+ key.Width = stream.ReadInt32();
+ key.Height = stream.ReadInt32();
+ key.Sticky = stream.ReadBoolean();
+
+ return key;
}
#endregion