Skip to content

Commit

Permalink
Moving things around so that the core WPFKeyboard library doesn't req…
Browse files Browse the repository at this point in the history
…uire native dlls. You only need the native stuff if you want the multi-lingual keyboard using KBD dll files.
  • Loading branch information
Paul Knopf committed Feb 25, 2014
1 parent d6e47ac commit ad6398f
Show file tree
Hide file tree
Showing 10 changed files with 155 additions and 37 deletions.
8 changes: 2 additions & 6 deletions Sample/KeyTemplates/SampleKeyControlBuilder.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Input;
using WindowsInput.Native;
using WindowsInput.Native;
using WPFKeyboard;
using WPFKeyboard.Models;

namespace Sample.KeyTemplates
Expand Down
5 changes: 1 addition & 4 deletions Sample/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using Sample.KeyTemplates;
using WPFKeyboard.Keyboards;
using WPFKeyboard;

namespace Sample
{
Expand All @@ -12,10 +12,7 @@ public MainWindow()
{
InitializeComponent();
VirtualKeyboard.OnScreenKeyControlBuilder = new SampleKeyControlBuilder();
//VirtualKeyboard.DataContext = new KPDOnScreenKeyboardViewModel(@"C:\Windows\SysWOW64\KBDVNTC.DLL");
VirtualKeyboard.DataContext = new KPDOnScreenKeyboardViewModel(@"C:\Windows\SysWOW64\KBDUS.DLL");
//VirtualKeyboard.DataContext = new KPDOnScreenKeyboardViewModel(@"C:\Windows\SysWOW64\KBDGR.DLL");
//VirtualKeyboard.DataContext = new KPDOnScreenKeyboardViewModel(@"C:\Windows\SysWOW64\KBDJPN.DLL");
}
}
}
4 changes: 4 additions & 0 deletions Sample/Sample.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,10 @@
<AppDesigner Include="Properties\" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\WPFKeyboard.KBD\WPFKeyboard.KBD.csproj">
<Project>{23207fa6-7dca-4ece-be26-1d0b25e4b326}</Project>
<Name>WPFKeyboard.KBD</Name>
</ProjectReference>
<ProjectReference Include="..\WPFKeyboard\WPFKeyboard.csproj">
<Project>{1b56a2ab-181d-4c58-9230-bf3f286a5d35}</Project>
<Name>WPFKeyboard</Name>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Input;
using WindowsInput.Native;
using WPFKeyboard.Models;
using WPFKeyboardNative;

namespace WPFKeyboard.Keyboards
namespace WPFKeyboard
{
/// <summary>
/// This view model uses a KPD dll to build the keyboard layout.
Expand Down Expand Up @@ -204,7 +200,7 @@ private BaseOnScreenKeyViewModel KeyForScanCode(int scanCode, KeyboardLayout lay

var scanCodeText = layout.CodeText.SingleOrDefault(x => x.ScanCode == scanCode);

return new Models.VirtualKey(virtualKey,
return new VirtualKey(virtualKey,
scanCodeText != null ? scanCodeText.Text : null,
virtualKeyInfo != null ? virtualKeyInfo.Characters.ToList() : new List<int>(),
virtualKeyInfo != null && virtualKeyInfo.Attributes == 1)
Expand Down
36 changes: 36 additions & 0 deletions WPFKeyboard.KBD/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// 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("WPFKeyboard.KBD")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("WPFKeyboard.KBD")]
[assembly: AssemblyCopyright("Copyright © 2014")]
[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("d0caa94a-cb5b-4c75-a279-cce7c0766a26")]

// 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 Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using WindowsInput;
using System.Collections.Generic;
using WindowsInput.Native;
using WPFKeyboard.Models;
using WPFKeyboardNative;

namespace WPFKeyboard.Models
namespace WPFKeyboard
{
public class VirtualKey : BaseOnScreenKeyViewModel, IButtonEventListener, IKeyEventListener
{
Expand Down
74 changes: 74 additions & 0 deletions WPFKeyboard.KBD/WPFKeyboard.KBD.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{23207FA6-7DCA-4ECE-BE26-1D0B25E4B326}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>WPFKeyboard</RootNamespace>
<AssemblyName>WPFKeyboard.KBD</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<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</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="MouseKeyboardActivityMonitor">
<HintPath>..\Dependencies\MouseKeyboardActivityMonitor.dll</HintPath>
</Reference>
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="WindowsBase" />
<Reference Include="WindowsInput">
<HintPath>..\Dependencies\WindowsInput.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="KPDOnScreenKeyboardViewModel.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="VirtualKey.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\WindowsKeyboardLayout\WindowsKeyboardLayout.vcxproj">
<Project>{ec8eb985-a262-4dc3-8d3e-ae38786c8b7d}</Project>
<Name>WindowsKeyboardLayout</Name>
</ProjectReference>
<ProjectReference Include="..\WPFKeyboard\WPFKeyboard.csproj">
<Project>{1b56a2ab-181d-4c58-9230-bf3f286a5d35}</Project>
<Name>WPFKeyboard</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.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>
33 changes: 33 additions & 0 deletions WPFKeyboard.sln
Original file line number Diff line number Diff line change
Expand Up @@ -12,48 +12,81 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WindowsKeyboardLayout", "Wi
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WindowsKeyboardLayoutTest", "WindowsKeyboardLayoutTest\WindowsKeyboardLayoutTest.vcxproj", "{F17016EA-957F-4728-8BF0-1D8893067EE8}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WPFKeyboard.KBD", "WPFKeyboard.KBD\WPFKeyboard.KBD.csproj", "{23207FA6-7DCA-4ECE-BE26-1D0B25E4B326}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "KBD", "KBD", "{AA19BF65-78DC-4BF4-B6FC-542188370F51}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|Mixed Platforms = Debug|Mixed Platforms
Debug|Win32 = Debug|Win32
Release|Any CPU = Release|Any CPU
Release|Mixed Platforms = Release|Mixed Platforms
Release|Win32 = Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{F12F830F-6B12-4D83-925B-01B2ABE37D8B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F12F830F-6B12-4D83-925B-01B2ABE37D8B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F12F830F-6B12-4D83-925B-01B2ABE37D8B}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
{F12F830F-6B12-4D83-925B-01B2ABE37D8B}.Debug|Mixed Platforms.Build.0 = Debug|x86
{F12F830F-6B12-4D83-925B-01B2ABE37D8B}.Debug|Win32.ActiveCfg = Debug|Any CPU
{F12F830F-6B12-4D83-925B-01B2ABE37D8B}.Debug|Win32.Build.0 = Debug|Any CPU
{F12F830F-6B12-4D83-925B-01B2ABE37D8B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F12F830F-6B12-4D83-925B-01B2ABE37D8B}.Release|Any CPU.Build.0 = Release|Any CPU
{F12F830F-6B12-4D83-925B-01B2ABE37D8B}.Release|Mixed Platforms.ActiveCfg = Release|x86
{F12F830F-6B12-4D83-925B-01B2ABE37D8B}.Release|Mixed Platforms.Build.0 = Release|x86
{F12F830F-6B12-4D83-925B-01B2ABE37D8B}.Release|Win32.ActiveCfg = Release|Any CPU
{F12F830F-6B12-4D83-925B-01B2ABE37D8B}.Release|Win32.Build.0 = Release|Any CPU
{1B56A2AB-181D-4C58-9230-BF3F286A5D35}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1B56A2AB-181D-4C58-9230-BF3F286A5D35}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1B56A2AB-181D-4C58-9230-BF3F286A5D35}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{1B56A2AB-181D-4C58-9230-BF3F286A5D35}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{1B56A2AB-181D-4C58-9230-BF3F286A5D35}.Debug|Win32.ActiveCfg = Debug|Any CPU
{1B56A2AB-181D-4C58-9230-BF3F286A5D35}.Debug|Win32.Build.0 = Debug|Any CPU
{1B56A2AB-181D-4C58-9230-BF3F286A5D35}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1B56A2AB-181D-4C58-9230-BF3F286A5D35}.Release|Any CPU.Build.0 = Release|Any CPU
{1B56A2AB-181D-4C58-9230-BF3F286A5D35}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{1B56A2AB-181D-4C58-9230-BF3F286A5D35}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{1B56A2AB-181D-4C58-9230-BF3F286A5D35}.Release|Win32.ActiveCfg = Release|Any CPU
{1B56A2AB-181D-4C58-9230-BF3F286A5D35}.Release|Win32.Build.0 = Release|Any CPU
{EC8EB985-A262-4DC3-8D3E-AE38786C8B7D}.Debug|Any CPU.ActiveCfg = Debug|Win32
{EC8EB985-A262-4DC3-8D3E-AE38786C8B7D}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
{EC8EB985-A262-4DC3-8D3E-AE38786C8B7D}.Debug|Mixed Platforms.Build.0 = Debug|Win32
{EC8EB985-A262-4DC3-8D3E-AE38786C8B7D}.Debug|Win32.ActiveCfg = Debug|Win32
{EC8EB985-A262-4DC3-8D3E-AE38786C8B7D}.Debug|Win32.Build.0 = Debug|Win32
{EC8EB985-A262-4DC3-8D3E-AE38786C8B7D}.Release|Any CPU.ActiveCfg = Release|Win32
{EC8EB985-A262-4DC3-8D3E-AE38786C8B7D}.Release|Mixed Platforms.ActiveCfg = Release|Win32
{EC8EB985-A262-4DC3-8D3E-AE38786C8B7D}.Release|Mixed Platforms.Build.0 = Release|Win32
{EC8EB985-A262-4DC3-8D3E-AE38786C8B7D}.Release|Win32.ActiveCfg = Release|Win32
{EC8EB985-A262-4DC3-8D3E-AE38786C8B7D}.Release|Win32.Build.0 = Release|Win32
{F17016EA-957F-4728-8BF0-1D8893067EE8}.Debug|Any CPU.ActiveCfg = Debug|Win32
{F17016EA-957F-4728-8BF0-1D8893067EE8}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
{F17016EA-957F-4728-8BF0-1D8893067EE8}.Debug|Mixed Platforms.Build.0 = Debug|Win32
{F17016EA-957F-4728-8BF0-1D8893067EE8}.Debug|Win32.ActiveCfg = Debug|Win32
{F17016EA-957F-4728-8BF0-1D8893067EE8}.Debug|Win32.Build.0 = Debug|Win32
{F17016EA-957F-4728-8BF0-1D8893067EE8}.Release|Any CPU.ActiveCfg = Release|Win32
{F17016EA-957F-4728-8BF0-1D8893067EE8}.Release|Mixed Platforms.ActiveCfg = Release|Win32
{F17016EA-957F-4728-8BF0-1D8893067EE8}.Release|Mixed Platforms.Build.0 = Release|Win32
{F17016EA-957F-4728-8BF0-1D8893067EE8}.Release|Win32.ActiveCfg = Release|Win32
{F17016EA-957F-4728-8BF0-1D8893067EE8}.Release|Win32.Build.0 = Release|Win32
{23207FA6-7DCA-4ECE-BE26-1D0B25E4B326}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{23207FA6-7DCA-4ECE-BE26-1D0B25E4B326}.Debug|Any CPU.Build.0 = Debug|Any CPU
{23207FA6-7DCA-4ECE-BE26-1D0B25E4B326}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{23207FA6-7DCA-4ECE-BE26-1D0B25E4B326}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{23207FA6-7DCA-4ECE-BE26-1D0B25E4B326}.Debug|Win32.ActiveCfg = Debug|Any CPU
{23207FA6-7DCA-4ECE-BE26-1D0B25E4B326}.Release|Any CPU.ActiveCfg = Release|Any CPU
{23207FA6-7DCA-4ECE-BE26-1D0B25E4B326}.Release|Any CPU.Build.0 = Release|Any CPU
{23207FA6-7DCA-4ECE-BE26-1D0B25E4B326}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{23207FA6-7DCA-4ECE-BE26-1D0B25E4B326}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{23207FA6-7DCA-4ECE-BE26-1D0B25E4B326}.Release|Win32.ActiveCfg = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{23207FA6-7DCA-4ECE-BE26-1D0B25E4B326} = {AA19BF65-78DC-4BF4-B6FC-542188370F51}
{F17016EA-957F-4728-8BF0-1D8893067EE8} = {AA19BF65-78DC-4BF4-B6FC-542188370F51}
{EC8EB985-A262-4DC3-8D3E-AE38786C8B7D} = {AA19BF65-78DC-4BF4-B6FC-542188370F51}
EndGlobalSection
EndGlobal
11 changes: 0 additions & 11 deletions WPFKeyboard/Models/EmptyKeyViewModel.cs

This file was deleted.

3 changes: 0 additions & 3 deletions WPFKeyboard/WPFKeyboard.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,11 @@
<Compile Include="IButtonEventListener.cs" />
<Compile Include="IKeyEventListener.cs" />
<Compile Include="Keyboard.cs" />
<Compile Include="Keyboards\KPDOnScreenKeyboardViewModel.cs" />
<Compile Include="Models\EmptyKeyViewModel.cs" />
<Compile Include="Models\OnScreenKeyboardViewModel.cs" />
<Compile Include="BaseViewModel.cs" />
<Compile Include="Models\OnScreenKeyboardRowViewModel.cs" />
<Compile Include="Models\OnScreenKeyboardSectionViewModel.cs" />
<Compile Include="Models\BaseOnScreenKeyViewModel.cs" />
<Compile Include="Models\VirtualKey.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Controls\OnScreenKeyboard.cs" />
</ItemGroup>
Expand Down

0 comments on commit ad6398f

Please sign in to comment.