From e0df170a198f6b875fbbe37a7fa8a3c5fdf3aa5c Mon Sep 17 00:00:00 2001 From: Ian C Date: Sun, 29 Apr 2012 23:05:51 +0000 Subject: Adding driver and test project. --- .../KeyboardTest/KeyboardTest/Background.png | Bin 0 -> 12776 bytes WindowsPhone/KeyboardTest/KeyboardTest/Game.ico | Bin 0 -> 4286 bytes WindowsPhone/KeyboardTest/KeyboardTest/Game1.cs | 124 +++++++++++++++++++++ .../KeyboardTest/KeyboardTest/KeyboardTest.csproj | 114 +++++++++++++++++++ .../KeyboardTest/KeyboardTest/PhoneGameThumb.png | Bin 0 -> 3176 bytes WindowsPhone/KeyboardTest/KeyboardTest/Program.cs | 21 ++++ .../KeyboardTest/Properties/AppManifest.xml | 6 + .../KeyboardTest/Properties/AssemblyInfo.cs | 36 ++++++ .../KeyboardTest/Properties/WMAppManifest.xml | 37 ++++++ .../KeyboardTest/KeyboardTest/Spectrum.keyboard | Bin 0 -> 235 bytes .../KeyboardTestContent.contentproj | 47 ++++++++ .../KeyboardTest/KeyboardTestContent/keyboard.png | Bin 0 -> 114056 bytes 12 files changed, 385 insertions(+) create mode 100644 WindowsPhone/KeyboardTest/KeyboardTest/Background.png create mode 100644 WindowsPhone/KeyboardTest/KeyboardTest/Game.ico create mode 100644 WindowsPhone/KeyboardTest/KeyboardTest/Game1.cs create mode 100644 WindowsPhone/KeyboardTest/KeyboardTest/KeyboardTest.csproj create mode 100644 WindowsPhone/KeyboardTest/KeyboardTest/PhoneGameThumb.png create mode 100644 WindowsPhone/KeyboardTest/KeyboardTest/Program.cs create mode 100644 WindowsPhone/KeyboardTest/KeyboardTest/Properties/AppManifest.xml create mode 100644 WindowsPhone/KeyboardTest/KeyboardTest/Properties/AssemblyInfo.cs create mode 100644 WindowsPhone/KeyboardTest/KeyboardTest/Properties/WMAppManifest.xml create mode 100644 WindowsPhone/KeyboardTest/KeyboardTest/Spectrum.keyboard create mode 100644 WindowsPhone/KeyboardTest/KeyboardTestContent/KeyboardTestContent.contentproj create mode 100644 WindowsPhone/KeyboardTest/KeyboardTestContent/keyboard.png (limited to 'WindowsPhone/KeyboardTest') diff --git a/WindowsPhone/KeyboardTest/KeyboardTest/Background.png b/WindowsPhone/KeyboardTest/KeyboardTest/Background.png new file mode 100644 index 0000000..4af7a5f Binary files /dev/null and b/WindowsPhone/KeyboardTest/KeyboardTest/Background.png differ diff --git a/WindowsPhone/KeyboardTest/KeyboardTest/Game.ico b/WindowsPhone/KeyboardTest/KeyboardTest/Game.ico new file mode 100644 index 0000000..8cff41e Binary files /dev/null and b/WindowsPhone/KeyboardTest/KeyboardTest/Game.ico 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 +{ + /// + /// This is the main type for your game + /// + 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 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); + } + + /// + /// 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. + /// + protected override void Initialize() + { + // TODO: Add your initialization logic here + + base.Initialize(); + } + + /// + /// LoadContent will be called once per game and is the place to load + /// all of your content. + /// + protected override void LoadContent() + { + // Create a new SpriteBatch, which can be used to draw textures. + spriteBatch = new SpriteBatch(GraphicsDevice); + + keyboardImage = Content.Load("keyboard"); + + KeyboardDefinition def; + + using (BinaryReader stream = new BinaryReader(TitleContainer.OpenStream(@"Spectrum.keyboard"))) + { + def = KeyboardDefinition.Load(stream); + } + + keyboard = new KeyboardDriver(keyboardImage, Vector2.Zero, def); + } + + /// + /// UnloadContent will be called once per game and is the place to unload + /// all content. + /// + protected override void UnloadContent() + { + // TODO: Unload any non ContentManager content here + } + + /// + /// Allows the game to run logic such as updating the world, + /// checking for collisions, gathering input, and playing audio. + /// + /// Provides a snapshot of timing values. + protected override void Update(GameTime gameTime) + { + // TODO: Add your update logic here + + base.Update(gameTime); + } + + /// + /// This is called when the game should draw itself. + /// + /// Provides a snapshot of timing values. + 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 @@ + + + + {A645334A-FABE-49EF-85EB-5A13871C266D} + {6D335F3A-9D43-41b4-9D22-F6F17C4BE596};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + Debug + Windows Phone + Library + Properties + KeyboardTest + KeyboardTest + v4.0 + Client + v4.0 + Windows Phone + Reach + dce4fe6e-26f4-43cf-971c-31f6e78066c4 + Game + 1 + false + $(AssemblyName).xap + Properties\AppManifest.xml + Properties\WMAppManifest.xml + Background.png + KeyboardTest + + + Game.ico + PhoneGameThumb.png + + + true + full + false + bin\Windows Phone\Debug + DEBUG;TRACE;WINDOWS_PHONE + prompt + 4 + true + false + false + + + pdbonly + true + bin\Windows Phone\Release + TRACE;WINDOWS_PHONE + prompt + 4 + true + false + false + + + + + + + + + + + + + + + + + + true + + + true + + + + + PreserveNewest + + + + + + true + + + true + + + + + {0F5AA96A-9253-4E06-A3F9-5517A2A9C558} + Noddybox.Emulation.Keyboard.Schema + + + {3B034AAA-A9FD-4307-95F2-D87BE0A51990} + Noddybox.Emulation.Xna.Keyboard + + + KeyboardTestContent + Content + + + + + + \ 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 Binary files /dev/null and b/WindowsPhone/KeyboardTest/KeyboardTest/PhoneGameThumb.png 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 + { + /// + /// The main entry point for the application. + /// + 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 @@ + + + + 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 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + + diff --git a/WindowsPhone/KeyboardTest/KeyboardTest/Spectrum.keyboard b/WindowsPhone/KeyboardTest/KeyboardTest/Spectrum.keyboard new file mode 100644 index 0000000..2607d6c Binary files /dev/null and b/WindowsPhone/KeyboardTest/KeyboardTest/Spectrum.keyboard 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 @@ + + + + {6BA269E1-4B99-43F2-A140-3454D78F4D17} + {96E2B04D-8817-42c6-938A-82C39BA4D311};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + Debug + x86 + Library + Properties + v4.0 + v4.0 + bin\$(Platform)\$(Configuration) + Content + + + x86 + + + x86 + + + KeyboardTestContent + + + + + + + + + + + + keyboard + TextureImporter + TextureProcessor + + + + + \ 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 Binary files /dev/null and b/WindowsPhone/KeyboardTest/KeyboardTestContent/keyboard.png differ -- cgit v1.2.3