Skip to content

Commit

Permalink
Initial commit of the touch keyboard notification sample code. This i…
Browse files Browse the repository at this point in the history
…s to support the RS1 feature of automatic touch keyboard invocation in WPF with code that shows how to get information about and react to touch keyboard occlusion.
  • Loading branch information
rladuca committed Aug 8, 2016
1 parent 1619aef commit 49e4049
Show file tree
Hide file tree
Showing 22 changed files with 1,474 additions and 0 deletions.
34 changes: 34 additions & 0 deletions Input and Commands/TouchKeyboard/TouchKBRegister.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.24720.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TouchKBRegister", "TouchKBRegister\TouchKBRegister.csproj", "{A8270645-EB8B-4F88-9BFB-DCA9B99C1B23}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TouchKeyboardNotifier", "TouchKeyboardNotifier\TouchKeyboardNotifier.csproj", "{B4C448D1-8853-4738-99E0-FAB7C7A63314}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{A8270645-EB8B-4F88-9BFB-DCA9B99C1B23}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A8270645-EB8B-4F88-9BFB-DCA9B99C1B23}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A8270645-EB8B-4F88-9BFB-DCA9B99C1B23}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A8270645-EB8B-4F88-9BFB-DCA9B99C1B23}.Release|Any CPU.Build.0 = Release|Any CPU
{B4C448D1-8853-4738-99E0-FAB7C7A63314}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B4C448D1-8853-4738-99E0-FAB7C7A63314}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B4C448D1-8853-4738-99E0-FAB7C7A63314}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B4C448D1-8853-4738-99E0-FAB7C7A63314}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(TeamFoundationVersionControl) = preSolution
SccNumberOfProjects = 1
SccEnterpriseProvider = {4CA58AB2-18FA-4F8D-95D4-32DDF27D184C}
SccTeamFoundationServer = http://vstfdevdiv:8080/devdiv2
SccLocalPath0 = .
EndGlobalSection
EndGlobal
6 changes: 6 additions & 0 deletions Input and Commands/TouchKeyboard/TouchKBRegister/App.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2"/>
</startup>
</configuration>
8 changes: 8 additions & 0 deletions Input and Commands/TouchKeyboard/TouchKBRegister/App.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<Application x:Class="TouchKBRegister.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:TouchKBRegister">
<Application.Resources>

</Application.Resources>
</Application>
26 changes: 26 additions & 0 deletions Input and Commands/TouchKeyboard/TouchKBRegister/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Navigation;

namespace TouchKBRegister
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
{
protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);
new MenuChild().Show();
new MenuSibling().Show();
new LotsOfStacking().Show();
new SxSDecorators().Show();
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<Window x:Class="TouchKBRegister.LotsOfStacking"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:tkn="clr-namespace:Microsoft.Windows.Input.TouchKeyboard;assembly=TouchKeyboardNotifier"
xmlns:local="clr-namespace:TouchKBRegister"
mc:Ignorable="d"
Title="Lots of Stacking" Height="3150" Width="525">
<StackPanel>
<Menu>
<MenuItem Header="File">
<MenuItem Header="Save"></MenuItem>
<MenuItem Header="Open"></MenuItem>
<MenuItem Header="Exit"></MenuItem>
</MenuItem>
</Menu>
<StackPanel>
<Button>Ooops</Button>
<StackPanel>
<tkn:TouchKeyboardAwareDecorator>
<StackPanel>
<Button Height="150">1</Button>
<Button Height="150">2</Button>
<TextBox Height="150">3</TextBox>
<TextBox Height="150">4</TextBox>
<TextBox Height="150">5</TextBox>
<ComboBox Height="150">
<ComboBox.Items>
<ComboBoxItem>1</ComboBoxItem>
<ComboBoxItem>2</ComboBoxItem>
<ComboBoxItem>3</ComboBoxItem>
<ComboBoxItem>4</ComboBoxItem>
<ComboBoxItem>5</ComboBoxItem>
<ComboBoxItem>6</ComboBoxItem>
</ComboBox.Items>
</ComboBox>
<TextBox Height="150">7</TextBox>
<TextBox Height="150">8</TextBox>
</StackPanel>
</tkn:TouchKeyboardAwareDecorator>
</StackPanel>
</StackPanel>
</StackPanel>
</Window>
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
using Microsoft.Windows.Input.TouchKeyboard;
using System.Diagnostics;
using System.Windows;
using System.Windows.Input;
using System.Windows.Media;

namespace TouchKBRegister
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class LotsOfStacking : Window
{
public LotsOfStacking()
{
InitializeComponent();
}
}
}
40 changes: 40 additions & 0 deletions Input and Commands/TouchKeyboard/TouchKBRegister/MenuChild.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<Window x:Class="TouchKBRegister.MenuChild"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:tkn="clr-namespace:Microsoft.Windows.Input.TouchKeyboard;assembly=TouchKeyboardNotifier"
xmlns:local="clr-namespace:TouchKBRegister"
mc:Ignorable="d"
Title="Menu Child" Height="3150" Width="525">
<tkn:TouchKeyboardAwareDecorator>
<StackPanel>
<Menu>
<MenuItem Header="File">
<MenuItem Header="Save"></MenuItem>
<MenuItem Header="Open"></MenuItem>
<MenuItem Header="Exit"></MenuItem>
</MenuItem>
</Menu>
<StackPanel>
<Button Height="150">1</Button>
<Button Height="150">2</Button>
<TextBox Height="150">3</TextBox>
<TextBox Height="150">4</TextBox>
<TextBox Height="150">5</TextBox>
<ComboBox Height="150">
<ComboBox.Items>
<ComboBoxItem>1</ComboBoxItem>
<ComboBoxItem>2</ComboBoxItem>
<ComboBoxItem>3</ComboBoxItem>
<ComboBoxItem>4</ComboBoxItem>
<ComboBoxItem>5</ComboBoxItem>
<ComboBoxItem>6</ComboBoxItem>
</ComboBox.Items>
</ComboBox>
<TextBox Height="150">7</TextBox>
<TextBox Height="150">8</TextBox>
</StackPanel>
</StackPanel>
</tkn:TouchKeyboardAwareDecorator>
</Window>
19 changes: 19 additions & 0 deletions Input and Commands/TouchKeyboard/TouchKBRegister/MenuChild.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
using Microsoft.Windows.Input.TouchKeyboard;
using System.Diagnostics;
using System.Windows;
using System.Windows.Input;
using System.Windows.Media;

namespace TouchKBRegister
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MenuChild : Window
{
public MenuChild()
{
InitializeComponent();
}
}
}
40 changes: 40 additions & 0 deletions Input and Commands/TouchKeyboard/TouchKBRegister/MenuSibling.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<Window x:Class="TouchKBRegister.MenuSibling"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:tkn="clr-namespace:Microsoft.Windows.Input.TouchKeyboard;assembly=TouchKeyboardNotifier"
xmlns:local="clr-namespace:TouchKBRegister"
mc:Ignorable="d"
Title="Menu Sibling" Height="3150" Width="525">
<StackPanel>
<Menu>
<MenuItem Header="File">
<MenuItem Header="Save"></MenuItem>
<MenuItem Header="Open"></MenuItem>
<MenuItem Header="Exit"></MenuItem>
</MenuItem>
</Menu>
<tkn:TouchKeyboardAwareDecorator>
<StackPanel>
<Button Height="150">1</Button>
<Button Height="150">2</Button>
<TextBox Height="150">3</TextBox>
<TextBox Height="150">4</TextBox>
<TextBox Height="150">5</TextBox>
<ComboBox Height="150">
<ComboBox.Items>
<ComboBoxItem>1</ComboBoxItem>
<ComboBoxItem>2</ComboBoxItem>
<ComboBoxItem>3</ComboBoxItem>
<ComboBoxItem>4</ComboBoxItem>
<ComboBoxItem>5</ComboBoxItem>
<ComboBoxItem>6</ComboBoxItem>
</ComboBox.Items>
</ComboBox>
<TextBox Height="150">7</TextBox>
<TextBox Height="150">8</TextBox>
</StackPanel>
</tkn:TouchKeyboardAwareDecorator>
</StackPanel>
</Window>
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
using Microsoft.Windows.Input.TouchKeyboard;
using System.Diagnostics;
using System.Windows;
using System.Windows.Input;
using System.Windows.Media;

namespace TouchKBRegister
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MenuSibling : Window
{
public MenuSibling()
{
InitializeComponent();
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Windows;

// 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("TouchKBRegister")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Microsoft Corporation")]
[assembly: AssemblyProduct("TouchKBRegister")]
[assembly: AssemblyCopyright("Copyright © 2016")]
[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)]

//In order to begin building localizable applications, set
//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file
//inside a <PropertyGroup>. For example, if you are using US english
//in your source files, set the <UICulture> to en-US. Then uncomment
//the NeutralResourceLanguage attribute below. Update the "en-US" in
//the line below to match the UICulture setting in the project file.

//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]


[assembly: ThemeInfo(
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
//(used if a resource is not found in the page,
// or application resource dictionaries)
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
//(used if a resource is not found in the page,
// app, or any theme specific resource dictionaries)
)]


// 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
@@ -0,0 +1,70 @@
<?xml version="1.0" encoding="utf-8"?>
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
<assemblyIdentity version="1.0.0.0" name="MyApplication.app" />
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
<!-- UAC Manifest Options
If you want to change the Windows User Account Control level replace the
requestedExecutionLevel node with one of the following.
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
<requestedExecutionLevel level="highestAvailable" uiAccess="false" />
Specifying requestedExecutionLevel element will disable file and registry virtualization.
Remove this element if your application requires this virtualization for backwards
compatibility.
-->
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
</requestedPrivileges>
<applicationRequestMinimum>
<defaultAssemblyRequest permissionSetReference="Custom" />
<PermissionSet class="System.Security.PermissionSet" version="1" ID="Custom" SameSite="site" />
</applicationRequestMinimum>
</security>
</trustInfo>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!-- A list of the Windows versions that this application has been tested on and is
is designed to work with. Uncomment the appropriate elements and Windows will
automatically selected the most compatible environment. -->
<!-- Windows Vista -->
<!--<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}" />-->
<!-- Windows 7 -->
<!--<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}" />-->
<!-- Windows 8 -->
<!--<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}" />-->
<!-- Windows 8.1 -->
<!--<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}" />-->
<!-- Windows 10 -->
<!--<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />-->
</application>
</compatibility>
<!-- Indicates that the application is DPI-aware and will not be automatically scaled by Windows at higher
DPIs. Windows Presentation Foundation (WPF) applications are automatically DPI-aware and do not need
to opt in. Windows Forms applications targeting .NET Framework 4.6 that opt into this setting, should
also set the 'EnableWindowsFormsHighDpiAutoResizing' setting to 'true' in their app.config. -->
<!--
<application xmlns="urn:schemas-microsoft-com:asm.v3">
<windowsSettings>
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>
</windowsSettings>
</application>
-->
<!-- Enable themes for Windows common controls and dialogs (Windows XP and later) -->
<!--
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="*"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
-->
</assembly>
Loading

0 comments on commit 49e4049

Please sign in to comment.