本文介绍了如何找到鼠标状态的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,
我正在做一个项目,我被困在一个要检查天气的地方,我的定点设备(鼠标)是否在工作.
我想以编程方式进行检查.
先感谢您. :)

Hello,
I am working on a project, and i got stuck at a point i want to check weather my pointing device(mouse) is working or not.
I want to check it programmatically .
Thank You in Advance. :)

推荐答案

SelectQuery selectQuery = new SelectQuery("Win32_PointingDevice");
ManagementObjectSearcher searcher = new ManagementObjectSearcher(selectQuery);

foreach (ManagementObject pointer in searcher.Get())
    {
    Console.WriteLine(pointer.ToString());
    }


但是直到用户移动它和/或单击按钮,您才能知道它是否有效.


But you can''t tell if it works until the user moves it, and / or clicks the buttons.


这篇关于如何找到鼠标状态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-21 19:04