Input: Get input device information, virtual keyboard, Tab navigation, pointer, Tap, Drag, Drop
Introduced
Re-imagine the Windows 8 Store Apps input
Enter information about the device
Application of SIP (Soft Input Panel)
Tab Key Navigation
Pointer-pointers, mouse
Tap-Touch
Drag and Drop
Example
1. Demonstrates how to obtain information about input devices
Input/inputdeviceinfo.xaml
<page
x:class= "XamlDemo.Input.InputDeviceInfo"
xmlns= "http://schemas.microsoft.com/winfx/2006/xaml/ Presentation "
xmlns:x=" Http://schemas.microsoft.com/winfx/2006/xaml "
xmlns:local=" Using:XamlDemo.Input "
xmlns:d=" http://schemas.microsoft.com/expression/blend/2008 "
xmlns:mc=" http:// schemas.openxmlformats.org/markup-compatibility/2006 "
mc:ignorable=" D ">
<grid background=" Transparent ">
<grid margin=" 0 0 0 ">
<scrollviewer margin=" 0 0 ">
<textblock Name= "lblmsg" fontsize= "14.667" textwrapping= "Wrap"/>
</ScrollViewer>
</Grid>
< /grid>
</Page>
Input/inputdeviceinfo.xaml.cs
* * Demonstrates how to obtain information about the input device * * using System;
Using Windows.Devices.Input;
Using Windows.UI.Xaml.Controls;
Using Windows.UI.Xaml.Navigation;
Namespace Xamldemo.input {public sealed partial class Inputdeviceinfo:page {public Inputdeviceinfo () {this.
InitializeComponent ();
} protected override void Onnavigatedto (NavigationEventArgs e) {//Get information about the mouse device
Mousecapabilities mousecapabilities = new Mousecapabilities (); Lblmsg.text = "Mousecapabilities.mousepresent:" + mousecapabilities.mousepresent;
Whether there is a mouse lblmsg.text + = Environment.NewLine; Lblmsg.text + = "Mousecapabilities.horizontalwheelpresent:" + mousecapabilities.horizontalwheelpresent;
Whether there is a horizontal roller lblmsg.text + = Environment.NewLine; Lblmsg.text + = "Mousecapabilities.verticalwheelpresent:" + mousecapabilities.verticalwheelpresent; Is there a vertical roller lblmsg.text + = EnvironmeNt.
newline; Lblmsg.text + = "Mousecapabilities.swapbuttons:" + mousecapabilities.swapbuttons;
Whether to exchange the left and right button lblmsg.text + = Environment.NewLine; Lblmsg.text + = "Mousecapabilities.numberofbuttons:" + mousecapabilities.numberofbuttons;
The number of buttons on the mouse lblmsg.text + = Environment.NewLine;
Lblmsg.text + = Environment.NewLine;
Get information about the hardware keyboard device keyboardcapabilities keyboardcapabilities = new Keyboardcapabilities (); Lblmsg.text + = "Keyboardcapabilities.keyboardpresent:" + keyboardcapabilities.keyboardpresent;
Is there a hardware keyboard lblmsg.text + = Environment.NewLine;
Lblmsg.text + = Environment.NewLine;
Get information about the touch device touchcapabilities touchcapabilities = new Touchcapabilities (); Lblmsg.text + = "Touchcapabilities.touchpresent:" + touchcapabilities.touchpresent;
Whether there is a touch device lblmsg.text + = Environment.NewLine; Lblmsg.text = "Touchcapabilities.contacts:" + touchcapabilities.contacts;
Touch device supported multi-touch points lblmsg.text + = Environment.NewLine;
Lblmsg.text + = Environment.NewLine;
Get information about pointer devices (touch, Pen, Mouse) var pointerdevicelist = Pointerdevice.getpointerdevices ();
int displayindex = 0;
foreach (Pointerdevice pointerdevice in pointerdevicelist) {displayindex++;
Lblmsg.text + = "pointer Device Index:" + displayindex;
Lblmsg.text + = Environment.NewLine; Lblmsg.text + = "Pointerdevice.pointerdevicetype:" + pointerdevice.pointerdevicetype;
Pointer type (touch, Pen, Mouse) Lblmsg.text + = Environment.NewLine; Lblmsg.text + = "pointerdevice.isintegrated:" + pointerdevice.isintegrated;
is the integrated device lblmsg.text + = Environment.NewLine; Lblmsg.text + = "pointerdevice.maxcontacts:" + PointerdeVice. maxcontacts;
The largest number of simultaneous touch points lblmsg.text + = Environment.NewLine; Lblmsg.text + = "Pointerdevice.physicaldevicerect:" + pointerdevice.physicaldevicerect;
Physical equipment of the Rect lblmsg.text + = Environment.NewLine; Lblmsg.text + = "Pointerdevice.screenrect:" + pointerdevice.screenrect;
The pointer device supports a screen of Rect lblmsg.text + = Environment.NewLine;
Lblmsg.text + = Environment.NewLine; }
}
}
}