惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

H
Hackread – Cybersecurity News, Data Breaches, AI and More
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
V
V2EX
T
The Blog of Author Tim Ferriss
腾讯CDC
Hugging Face - Blog
Hugging Face - Blog
雷峰网
雷峰网
爱范儿
爱范儿
GbyAI
GbyAI
H
Help Net Security
I
InfoQ
罗磊的独立博客
酷 壳 – CoolShell
酷 壳 – CoolShell
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
人人都是产品经理
人人都是产品经理
J
Java Code Geeks
Microsoft Security Blog
Microsoft Security Blog
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
N
Netflix TechBlog - Medium
Last Week in AI
Last Week in AI
宝玉的分享
宝玉的分享
云风的 BLOG
云风的 BLOG
Project Zero
Project Zero
P
Privacy & Cybersecurity Law Blog
A
Arctic Wolf
Know Your Adversary
Know Your Adversary
G
Google Developers Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
T
Tor Project blog
V
Vulnerabilities – Threatpost
Y
Y Combinator Blog
WordPress大学
WordPress大学
V
Visual Studio Blog
博客园_首页
G
GRAHAM CLULEY
K
Kaspersky official blog
T
Tailwind CSS Blog
T
Threat Research - Cisco Blogs
博客园 - Franky
D
Docker
Security Latest
Security Latest
I
Intezer
有赞技术团队
有赞技术团队
Application and Cybersecurity Blog
Application and Cybersecurity Blog
博客园 - 【当耐特】
B
Blog RSS Feed
T
The Exploit Database - CXSecurity.com
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻

博客园 - my favorite

【转】QT样式表 (QStyleSheet) 【转】Qt事件循环与线程 二 [转]Qt 智能指针学习 【转】Android Web Server 【转】Android Http Server Java Annotation 注释语法 android中json的序列化与反序列化 JavaScript定义类的几种方式 js获取浏览器高度和宽度值(多浏览器) Setting up SSL made easy… Better, Faster, Easier SSL testing for ASP.NET MVC & WebForms ASP.NET MVC 3 Internationalization Windows 8 学习笔记(十四)--.map文件与.kml文件的解析 Windows 8学习笔记(十二)--集合控件 Windows 8 学习笔记(十三)--生命周期 Windows 8学习笔记(十一)---图片的显示与保存 Windows 8 Metro App学习笔记(九)—磁砖 Windows 8学习笔记(十)----Notification Windows 8 学习笔记(八)--各种流之间的转换
Windows 8学习笔记(七)--Input输入设备
my favorite · 2012-07-03 · via 博客园 - my favorite

Windows.Device.Input接口提供了识别可用的输入设备并获得这些设备的信息

KeyboardCapabilities

用于判断当前是否连接了键盘设备

其属性KeyboardPresent进行判断,当为0时表示未连接,不为0时表示已连接

Windows.Devices.Input.KeyboardCapabilities KeyboardCapabilities = new Windows.Devices.Input.KeyboardCapabilities();

string status = string.Format("There is {0} keyboard present\n", KeyboardCapabilities.KeyboardPresent != 0 ? "a" : "no");

MouseCapabilities

用于判断当前是否连接了鼠标设备

其属性比KeyboardCapabilities多了些,如下:

HorizontalWheelPresent 该值表明是否有带水平滚轮的鼠标连接

MousePresent 表明是否有鼠标连接

NumberOfButtons 该值表明当前连接的鼠标中按钮的数量,若有多个鼠标连接,则返回鼠标按钮个数最多的数量

SwapButtons 该值表明当前连接的鼠标设备中是否具有左右交换按钮的

VerticalWheelPresent 该值表明当前连接的鼠标设备中是否有垂直的滚轮

Windows.Devices.Input.MouseCapabilities MouseCapabilities = new Windows.Devices.Input.MouseCapabilities();

 String info = string.Format("There is {0} mouse present\n", MouseCapabilities.MousePresent != 0 ? "a" : "no");

 info += string.Format("There is {0} vertical mouse wheel present\n", MouseCapabilities.VerticalWheelPresent != 0 ? "a" : "no");

 info += string.Format("There is {0} horizontal mouse wheel present\n", MouseCapabilities.HorizontalWheelPresent != 0 ? "a" : "no");

 info += string.Format("The user has {0}opted to swap the mouse buttons\n", MouseCapabilities.SwapButtons != 0 ? "" : "not ");

 info += string.Format("The mouse has {0} button(s)\n", MouseCapabilities.NumberOfButtons);

TouchCapabilities

获得连接的触摸数字化仪的功能

Contats 表明支持所有数字化仪的最小联系人数量

TouchPresent 表明当前终端是否有数据化仪

Windows.Devices.Input.TouchCapabilities TouchCapabilities = new Windows.Devices.Input.TouchCapabilities();

 String info = string.Format("There is {0} digitizer present\n", TouchCapabilities.TouchPresent != 0 ? "a" : "no");

info += string.Format("The digitizer supports {0} contacts\n", TouchCapabilities.Contacts);

PointerDevice

识别连接的指针设备及它们的功能

var PointerDeviceList = Windows.Devices.Input.PointerDevice.GetPointerDevices();

            string device="";

            foreach (Windows.Devices.Input.PointerDevice PointerDevice in PointerDeviceList)

            {

                 if (PointerDevice.PointerDeviceType == Windows.Devices.Input.PointerDeviceType.Mouse)

                {

                    device ="mouse";

                }

                else if (PointerDevice.PointerDeviceType == Windows.Devices.Input.PointerDeviceType.Pen)

                {

                    device= "pen";

                }

                else

                {

                    device= "touch";

                }

            }

今天就看了一点输入设备的功能用法,研究SMS收发信息的功能时,却被刚开始的 SmsDevice.GetDefaultAsync()获取信息设备给绊住了,报的错误是”服务尚未启动。 (异常来自 HRESULT:0x80070426) ”,不知道是不是要先开启什么,望知者还能提醒一番^_^

Trackback:

http://www.cnblogs.com/jing870812/archive/2012/04/11/2443124.html